/* generated by Id 1.0 at 2007-02-09 18:34:23 Z */
/* with the command: -I/usr/local/lib/idc/i386-apple-darwin8.8.1/ -I. -I../objects -m bench-id.st -o bench-id.c */

#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <setjmp.h>
#include <string.h>
#include <ctype.h>
#include <fcntl.h>
#include <unistd.h>
#include <time.h>
#include <sys/time.h>
#include <sys/stat.h>
#include <sys/param.h>
#include <assert.h>
#define GC_DLL 1
#include <gc/gc.h>
#if defined(WIN32)
# include <malloc.h>
# include <windows.h>
  typedef HINSTANCE dlhandle_t;
# define dlopen(path, mode)	LoadLibrary(path)
# define dlsym(handle, name)	((void *)GetProcAddress(handle, name))
# define dlclose(handle)	FreeLibrary(handle)
# include <winbase.h>
  inline int gettimeofday(struct timeval *tp, void *tzp)
  {
     union {
       long long ns100;
       FILETIME ft;
     } _now;
     GetSystemTimeAsFileTime(&_now.ft);
     tp->tv_usec= (long)((_now.ns100 / 10LL) % 1000000LL);
     tp->tv_sec= (long)((_now.ns100 - (116444736000000000LL)) / 10000000LL);
     return 0;
   }
#else
# include <dlfcn.h>
  typedef void *dlhandle_t;
#endif
#ifndef O_BINARY
# define O_BINARY 0
#endif

typedef struct t__object *oop;

typedef oop (*_imp_t)(oop _thunk, oop receiver, ...);

struct __closure
{
  _imp_t method;
  oop	 data;
};

static void              *(*_local_param   )(int index)= 0;
static oop  		  (*_local_intern  )(const char *string)= 0;
static oop  		  (*_local_proto   )(oop base)= 0;
static oop  		  (*_local_import  )(const char *name)= 0;
static oop  		  (*_local_export  )(const char *name, oop value)= 0;
static void 		  (*_local_method  )(oop type, oop selector, _imp_t method)= 0;
static oop  		  (*_local_alloc   )(oop type, size_t size)= 0;
static oop  		 *(*_local_palloc  )(size_t size)= 0;
static void  		 *(*_local_balloc  )(size_t size)= 0;
static struct __closure  *(*_local_bind    )(oop selector, oop receiver)= 0;
static oop                (*_local_nlreturn)(oop nlr, oop result)= 0;
static oop                (*_local_nlresult)(void)= 0;
static oop  		    _local_object= 0;
static oop  		   *_local_tag_vtable= 0;
static oop  		   *_local_nil_vtable= 0;
static void               (*_local_gc_addRoots)(char *lo, char *hi)= 0;
static void	          (*_local_gc_unregisterDisappearingLink)(void *ptr)= 0;
static void		  (*_local_gc_generalRegisterDisappearingLink)(void *link, void *ptr)= 0;
static void		  (*_local_gc_gcollect)(void)= 0;

#define _param(INDEX)		_local_param(INDEX)
#define _selector(NAME)		_local_intern(NAME)
#define _proto(BASE)		_local_proto(BASE)
#define _id_import(NAME)	_local_import(NAME)
#define _id_export(NAME, VAL)	_local_export((NAME), (VAL))
#define _method(TYPE, SEL, IMP)	_local_method((TYPE), (SEL), (_imp_t)(IMP))
#define _alloc(RCV, LBS)	_local_alloc((RCV), (LBS))
#define _palloc(LBS)		_local_palloc((LBS))
#define _balloc(LBS)		_local_balloc((LBS))
#define _nlreturn(NLR, ARG)	_local_nlreturn((NLR), (ARG))
#define _nlresult()		_local_nlresult()

#define _send(MSG, RCV, ARG...) ({					\
  register oop _r= (RCV);						\
  struct __closure *_c= (struct __closure *)_local_bind((MSG), _r);	\
  (_c->method)((oop)_c, _r, ##ARG);					\
})

#define _super(TYP, MSG, RCV, ARG...) ({				\
  struct __closure *_c= (struct __closure *)_local_bind((MSG), (TYP));	\
  (_c->method)((oop)_c, (RCV), ##ARG);					\
})

static oop s__2d= 0;
static oop s_cr= 0;
static oop s__2b= 0;
static oop s_ifTrue_ifFalse_= 0;
static oop s_nfibs= 0;
static oop s_value_5f_= 0;
static oop s__3c= 0;
static oop s__5fimport_= 0;
static oop s_print_= 0;
static struct _Selector { const char *name; oop *addr; } _Selectors[]= {
  { "-", &s__2d },
  { "cr", &s_cr },
  { "+", &s__2b },
  { "ifTrue:ifFalse:", &s_ifTrue_ifFalse_ },
  { "nfibs", &s_nfibs },
  { "value_:", &s_value_5f_ },
  { "<", &s__3c },
  { "_import:", &s__5fimport_ },
  { "print:", &s_print_ },
  { 0, 0 }
};
struct t__object {
  struct _vtable *_vtable[0];
};
struct t__selector {
  struct _vtable *_vtable[0];
  oop v__size;
  oop v__elements;
};
struct t__assoc {
  struct _vtable *_vtable[0];
  oop v_key;
  oop v_value;
};
struct t__closure {
  struct _vtable *_vtable[0];
  oop v__method;
  oop v_data;
};
struct t__vector {
  struct _vtable *_vtable[0];
  oop v__size;
};
struct t__vtable {
  struct _vtable *_vtable[0];
  oop v__tally;
  oop v_bindings;
  oop v_delegate;
};
struct t_Object {
  struct _vtable *_vtable[0];
};
struct t_UndefinedObject {
  struct _vtable *_vtable[0];
};
struct t_Magnitude {
  struct _vtable *_vtable[0];
};
struct t_Date {
  struct _vtable *_vtable[0];
  oop v__seconds;
  oop v__microseconds;
};
struct t_Time {
  struct _vtable *_vtable[0];
  oop v__seconds;
  oop v__nanoseconds;
};
struct t_Number {
  struct _vtable *_vtable[0];
};
struct t_Float {
  struct _vtable *_vtable[0];
};
struct t_Integer {
  struct _vtable *_vtable[0];
};
struct t_SmallInteger {
  struct _vtable *_vtable[0];
};
struct t_LargeInteger {
  struct _vtable *_vtable[0];
};
struct t_Symbol {
  struct _vtable *_vtable[0];
  oop v__size;
  oop v__elements;
};
struct t_Association {
  struct _vtable *_vtable[0];
  oop v_key;
  oop v_value;
};
struct t_Collection {
  struct _vtable *_vtable[0];
};
struct t_SequenceableCollection {
  struct _vtable *_vtable[0];
};
struct t_ArrayedCollection {
  struct _vtable *_vtable[0];
  oop v_size;
};
struct t_Array {
  struct _vtable *_vtable[0];
  oop v_size;
  oop v__oops;
};
struct t_ByteArray {
  struct _vtable *_vtable[0];
  oop v_size;
  oop v__bytes;
};
struct t_String {
  struct _vtable *_vtable[0];
  oop v_size;
  oop v__bytes;
};
struct t_OrderedCollection {
  struct _vtable *_vtable[0];
  oop v_firstIndex;
  oop v_lastIndex;
  oop v_array;
};
struct t_IdentitySet {
  struct _vtable *_vtable[0];
  oop v_tally;
  oop v_lists;
};
struct t_IdentityDictionary {
  struct _vtable *_vtable[0];
  oop v_tally;
  oop v_lists;
};
struct t_FastIdentityDictionary {
  struct _vtable *_vtable[0];
  oop v_tally;
  oop v_lists;
};
struct t_SlotDictionary {
  struct _vtable *_vtable[0];
  oop v__size;
  oop v__tally;
  oop v__keys;
  oop v__values;
  oop v_default;
};
struct t_StaticBlockClosure {
  struct _vtable *_vtable[0];
  oop v__function;
  oop v__arity;
};
struct t_BlockClosure {
  struct _vtable *_vtable[0];
  oop v__function;
  oop v__arity;
  oop v_outer;
  oop v_state;
  oop v__nlr;
};
struct t_SinkStream {
  struct _vtable *_vtable[0];
};
struct t_ReadStream {
  struct _vtable *_vtable[0];
  oop v_collection;
  oop v_position;
  oop v_readLimit;
};
struct t_WriteStream {
  struct _vtable *_vtable[0];
  oop v_collection;
  oop v_position;
  oop v_readLimit;
  oop v_writeLimit;
};
struct t_FileStream {
  struct _vtable *_vtable[0];
  oop v_collection;
  oop v_position;
  oop v_readLimit;
  oop v_file;
};
struct t_ConsoleFileStream {
  struct _vtable *_vtable[0];
  oop v_collection;
  oop v_position;
  oop v_readLimit;
  oop v_file;
  oop v__prompt;
};
struct t_File {
  struct _vtable *_vtable[0];
  oop v__fd;
  oop v_name;
};
struct t_Function {
  struct _vtable *_vtable[0];
};
struct t_Random {
  struct _vtable *_vtable[0];
  oop v_seed;
  oop v_a;
  oop v_m;
  oop v_q;
  oop v_r;
};
struct t_Link {
  struct _vtable *_vtable[0];
  oop v_prevLink;
  oop v_nextLink;
};
struct t_LinkedList {
  struct _vtable *_vtable[0];
  oop v_firstLink;
  oop v_lastLink;
};
struct t_OS {
  struct _vtable *_vtable[0];
};
struct t_nil {
  struct _vtable *_vtable[0];
};
struct t_true {
  struct _vtable *_vtable[0];
};
struct t_false {
  struct _vtable *_vtable[0];
};
struct t_FastIdentitySet {
  struct _vtable *_vtable[0];
  oop v_tally;
  oop v_lists;
};
struct t_MemoDictionary {
  struct _vtable *_vtable[0];
  oop v__size;
  oop v__tally;
  oop v__keys;
  oop v__values;
  oop v_default;
};
struct t_SharedFile {
  struct _vtable *_vtable[0];
  oop v__fd;
  oop v_name;
  oop v_readStream;
};
static oop l_1= 0;
static oop l_2= 0;
static oop l_3= 0;
static oop v__object= 0;
static oop v_Object= 0;
static oop v_UndefinedObject= 0;
static oop v_Magnitude= 0;
static oop v_Number= 0;
static oop v_Integer= 0;
static oop v_SmallInteger= 0;
static oop v_Collection= 0;
static oop v_SequenceableCollection= 0;
static oop v_ArrayedCollection= 0;
static oop v_ByteArray= 0;
static oop v_IdentitySet= 0;
static oop v_IdentityDictionary= 0;
static oop v_SlotDictionary= 0;
static oop v_StaticBlockClosure= 0;
static oop v_ReadStream= 0;
static oop v_FileStream= 0;
static oop v_File= 0;
static oop v_true= 0;
static oop v_false= 0;
static oop v_StdOut= 0;
static oop Integer__nfibs(oop v__closure, oop v_self)
 {
  oop _1= 0;
  oop _2= 0;
  oop _3= 0;
  /* ifTrue:ifFalse: */
  _1= v_self;
  _2= l_1;
  if (1 & (int)_1) {
    _1= (((int)_1 < (int)_2) ? v_true : v_false);
  } else _1= _send(s__3c, _1, _2);
  if (!_1) goto _l1;
 {
  _1= l_2;
 }
  goto _l2;
 _l1:;
 {
  _1= v_self;
  _2= l_2;
  {
    int _l= (int)_1 >> 1;
    int _r= (int)_2 >> 1;
    int _s= (_l - _r);
    if ((1 & (int)_1) && ((_s ^ (_s << 1)) >= 0))  _1= (oop)(_s << 1 | 1);  else _1= _send(s__2d, _1, _2);
  }
  _1=_send(s_nfibs, _1);
  _2= v_self;
  _3= l_1;
  {
    int _l= (int)_2 >> 1;
    int _r= (int)_3 >> 1;
    int _s= (_l - _r);
    if ((1 & (int)_2) && ((_s ^ (_s << 1)) >= 0))  _2= (oop)(_s << 1 | 1);  else _2= _send(s__2d, _2, _3);
  }
  _2=_send(s_nfibs, _2);
  {
    int _l= (int)_1 >> 1;
    int _r= (int)_2 >> 1;
    int _s= _l + _r;
    if ((1 & (int)_1 & (int)_2) && ((_s ^ (_s << 1)) >= 0))  _1= (oop)(_s << 1 | 1);  else _1= _send(s__2b, _1, _2);
  }
  _2= l_2;
  {
    int _l= (int)_1 >> 1;
    int _r= (int)_2 >> 1;
    int _s= _l + _r;
    if ((1 & (int)_1) && ((_s ^ (_s << 1)) >= 0))  _1= (oop)(_s << 1 | 1);  else _1= _send(s__2b, _1, _2);
  }
 }
 _l2:;
  return _1;
 }

void __id__init__(void)
{
  if (_local_object) return;
  { 
    dlhandle_t global= dlopen(0, RTLD_LAZY);
    _local_object= *(oop *)dlsym(global, "_libid_object");
    _local_param= dlsym(global, "_libid_param");
    _local_intern= dlsym(global, "_libid_intern");
    _local_proto= dlsym(global, "_libid_proto");
    _local_import= dlsym(global, "_libid_import");
    _local_export= dlsym(global, "_libid_export");
    _local_method= dlsym(global, "_libid_method");
    _local_alloc= dlsym(global, "_libid_alloc");
    _local_palloc= dlsym(global, "_libid_palloc");
    _local_balloc= dlsym(global, "_libid_balloc");
    _local_bind= dlsym(global, "_libid_bind");
    _local_nlreturn= dlsym(global, "_libid_nlreturn");
    _local_nlresult= dlsym(global, "_libid_nlresult");
    _local_tag_vtable= dlsym(global, "_libid_tag_vtable");
    _local_nil_vtable= dlsym(global, "_libid_nil_vtable");
    _local_gc_addRoots= dlsym(global, "GC_add_roots");
    _local_gc_unregisterDisappearingLink= dlsym(global, "GC_unregister_disappearing_link");
    _local_gc_generalRegisterDisappearingLink= dlsym(global, "GC_general_register_disappearing_link");
    _local_gc_gcollect= dlsym(global, "GC_gcollect");
    dlclose(global);
  }
  {
    struct _Selector *s= 0;
    for (s= _Selectors;  s->name;  ++s)
      *s->addr= _selector(s->name);
  }

  _send(s__5fimport_, _local_object, "Object", "__id__init__Object");
  _send(s__5fimport_, _local_object, "Objects", "__id__init__Objects");
  _send(s__5fimport_, _local_object, "_object", "__id__init___5fobject");
  v__object= _id_import("_object");
  v_Object= _id_import("Object");
  v_UndefinedObject= _id_import("UndefinedObject");
  v_Magnitude= _id_import("Magnitude");
  v_Number= _id_import("Number");
  v_Integer= _id_import("Integer");
  v_SmallInteger= _id_import("SmallInteger");
  v_Collection= _id_import("Collection");
  v_SequenceableCollection= _id_import("SequenceableCollection");
  v_ArrayedCollection= _id_import("ArrayedCollection");
  v_ByteArray= _id_import("ByteArray");
  v_IdentitySet= _id_import("IdentitySet");
  v_IdentityDictionary= _id_import("IdentityDictionary");
  v_SlotDictionary= _id_import("SlotDictionary");
  v_StaticBlockClosure= _id_import("StaticBlockClosure");
  v_ReadStream= _id_import("ReadStream");
  v_FileStream= _id_import("FileStream");
  v_File= _id_import("File");
  v_true= _id_import("true");
  v_false= _id_import("false");
  v_StdOut= _id_import("StdOut");
  _send(s__5fimport_, _local_object, "SmallInteger", "__id__init__SmallInteger");
  _send(s__5fimport_, _local_object, "String", "__id__init__String");
  _send(s__5fimport_, _local_object, "Symbol", "__id__init__Symbol");
  _send(s__5fimport_, _local_object, "BlockClosure", "__id__init__BlockClosure");
  _send(s__5fimport_, _local_object, "Collection", "__id__init__Collection");
  _send(s__5fimport_, _local_object, "SequenceableCollection", "__id__init__SequenceableCollection");
  _send(s__5fimport_, _local_object, "ArrayedCollection", "__id__init__ArrayedCollection");
  _send(s__5fimport_, _local_object, "Array", "__id__init__Array");
  _send(s__5fimport_, _local_object, "ByteArray", "__id__init__ByteArray");
  _send(s__5fimport_, _local_object, "IdentitySet", "__id__init__IdentitySet");
  _send(s__5fimport_, _local_object, "Association", "__id__init__Association");
  _send(s__5fimport_, _local_object, "IdentityDictionary", "__id__init__IdentityDictionary");
  _send(s__5fimport_, _local_object, "SlotDictionary", "__id__init__SlotDictionary");
  _send(s__5fimport_, _local_object, "MemoDictionary", "__id__init__MemoDictionary");
  _send(s__5fimport_, _local_object, "OrderedCollection", "__id__init__OrderedCollection");
  _send(s__5fimport_, _local_object, "File", "__id__init__File");
  _send(s__5fimport_, _local_object, "Stream", "__id__init__Stream");
  _send(s__5fimport_, _local_object, "Link", "__id__init__Link");
  _send(s__5fimport_, _local_object, "LinkedList", "__id__init__LinkedList");
  _send(s__5fimport_, _local_object, "Number", "__id__init__Number");
  _send(s__5fimport_, _local_object, "OS", "__id__init__OS");
  _send(s__5fimport_, _local_object, "Function", "__id__init__Function");
  _send(s__5fimport_, _local_object, "Time", "__id__init__Time");
  _send(s__5fimport_, _local_object, "Date", "__id__init__Date");
  _send(s__5fimport_, _local_object, "Random", "__id__init__Random");
  _send(s__5fimport_, _local_object, "deprecated", "__id__init__deprecated");
  l_1= _send(s_value_5f_, v_SmallInteger, 2);
  l_2= _send(s_value_5f_, v_SmallInteger, 1);
  _method(v_Integer, s_nfibs, Integer__nfibs);
  l_3= _send(s_value_5f_, v_SmallInteger, 38);
 {
  oop _1= 0;
  oop _2= 0;
  _1= v_StdOut;
  _2= l_3;
  _2=_send(s_nfibs, _2);
  _send(s_print_, _1, _2);
  _1=_send(s_cr, _1);
 }
}

int main(int argc, char **argv, char **envp)
{
  dlhandle_t global= dlopen(0, RTLD_LAZY);
  void *_local_init= dlsym(global, "_libid_init");
  if (!_local_init) { fprintf(stderr, "id runtime not found\n");  abort(); }
  ((void (*)(int *, char ***, char ***))_local_init)(&argc, &argv, &envp);
  __id__init__();
  dlclose(global);
  return 0;
}
