// File: /workspace/github_c_makefile_star2_O0/ajpaulson[P]srogue11/state.c
// Function: rs_restore_file
int rs_restore_file(int inf)
{
    bool junk;
    int endian = 0x01020304;
    big_endian = ( *((char *)&endian) == 0x01 );
    
    rs_read_daemons(inf, d_list, MAXDAEMONS);
    rs_read_int(inf, &between);
    rs_read_rooms(inf, rooms, MAXROOMS);
    rs_read_room_reference(inf, &oldrp);
    rs_read_monster_list(inf, &mlist);
    rs_read_thing(inf, &player);
    rs_read_stats(inf,&max_stats);                   
    rs_read_object_list(inf, &lvl_obj);
    rs_read_object_reference(inf, player.t_pack, &cur_weapon); 
    rs_read_object_reference(inf, player.t_pack, &cur_armor);
    rs_read_object_reference(inf, player.t_pack, &cur_ring[0]);
    rs_read_object_reference(inf, player.t_pack, &cur_ring[1]);
    him = &player.t_stats;
    rs_read_traps(inf, traps, MAXTRAPS);             

    rs_read_int(inf, &level);
    rs_read_int(inf, &levcount);
    rs_read_int(inf, &levtype);
    rs_read_int(inf, &trader);
    rs_read_int(inf, &curprice);
    rs_read_int(inf, &purse);
    rs_read_int(inf, &ntraps);
    rs_read_int(inf, &packvol);
    rs_read_int(inf, &demoncnt);
    rs_read_int(inf, &lastscore);
    rs_read_int(inf, &no_food);
    rs_read_int(inf, &seed);
    rs_read_int(inf, &dnum);
    rs_read_int(inf, &count);
    rs_read_int(inf, &fung_hit);
    rs_read_int(inf, &quiet);
    rs_read_int(inf, &max_level);
    rs_read_int(inf, &food_left);
    rs_read_int(inf, &group);
    rs_read_int(inf, &hungry_state);
    rs_read_int(inf, &foodlev);
    rs_read_int(inf, &ringfood);
    rs_read_char(inf, &take);
    rs_read_char(inf, &runch);
    rs_read(inf, curpurch, 15);

    rs_read(inf, prbuf, LINLEN);
    rs_read(inf, whoami, LINLEN);
    rs_read(inf, fruit, LINLEN);
    
    rs_read_boolean(inf, &isfight); 
    rs_read_boolean(inf, &nlmove);
    rs_read_boolean(inf, &inpool);
    rs_read_boolean(inf, &inwhgt);
    rs_read_boolean(inf, &running);
    rs_read_boolean(inf, &playing);
#ifdef WIZARD
    rs_read_boolean(inf, &wizard);
#else
    rs_read_boolean(inf, &junk);
#endif
    rs_read_boolean(inf, &after);
    rs_read_boolean(inf, &door_stop);
    rs_read_boolean(inf, &firstmove);
    rs_read_boolean(inf, &waswizard);
    rs_read_boolean(inf, &amulet);
    rs_read_boolean(inf, &in_shell);
    rs_read_boolean(inf, &nochange);
    
    rs_read_coord(inf, &oldpos);
    rs_read_coord(inf, &delta);
    rs_read_coord(inf, &stairs);
    rs_read_coord(inf, &rndspot);

    rs_read_monsters(inf, monsters, MAXMONS+1);
    rs_read_monster_references(inf, mtlev, MONRANGE);

    rs_read_scrolls(inf);
    rs_read_potions(inf);
    rs_read_rings(inf);
    rs_read_sticks(inf);

    rs_read_magic_items(inf, things, NUMTHINGS+1);
    rs_read_magic_items(inf, a_magic, MAXARMORS+1);
    rs_read_magic_items(inf, w_magic, MAXWEAPONS+1);
    rs_read_magic_items(inf, s_magic, MAXSCROLLS+1);
    rs_read_magic_items(inf, p_magic, MAXPOTIONS+1);
    rs_read_magic_items(inf, r_magic, MAXRINGS+1);
    rs_read_magic_items(inf, ws_magic, MAXSTICKS+1);

    rs_read_window(inf, cw);
    rs_read_window(inf, mw);
    rs_read_window(inf, stdscr);

    return(READSTAT);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0x4(%rbp)
movl $0x1020304, -0xc(%rbp)  # imm = 0x1020304
movsbl -0xc(%rbp), %eax
cmpl $0x1, %eax
sete %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, 0x1bc39(%rip)     # 0x3c900
movl -0x4(%rbp), %edi
leaq 0x15d9f(%rip), %rsi     # 0x36a70
movl $0x14, %edx
callq 0x1da20
movl -0x4(%rbp), %edi
leaq 0x15f6b(%rip), %rsi     # 0x36c50
callq 0x1c810
movl -0x4(%rbp), %edi
leaq 0x1602c(%rip), %rsi     # 0x36d20
movl $0x9, %edx
callq 0x1e0b0
movl -0x4(%rbp), %edi
leaq 0x163c0(%rip), %rsi     # 0x370c8
callq 0x1de70
movl -0x4(%rbp), %edi
leaq 0x15f99(%rip), %rsi     # 0x36cb0
callq 0x1fdc0
movl -0x4(%rbp), %edi
leaq 0x163aa(%rip), %rsi     # 0x370d0
callq 0x1fa50
movl -0x4(%rbp), %edi
leaq 0x16433(%rip), %rsi     # 0x37168
callq 0x1e740
movl -0x4(%rbp), %edi
leaq 0x15f74(%rip), %rsi     # 0x36cb8
callq 0x1f040
movl -0x4(%rbp), %edi
leaq 0x1637d(%rip), %rax     # 0x370d0
movq 0x68(%rax), %rsi
leaq 0x15f62(%rip), %rdx     # 0x36cc0
callq 0x1ff60
movl -0x4(%rbp), %edi
leaq 0x16363(%rip), %rax     # 0x370d0
movq 0x68(%rax), %rsi
leaq 0x15f50(%rip), %rdx     # 0x36cc8
callq 0x1ff60
movl -0x4(%rbp), %edi
leaq 0x16349(%rip), %rax     # 0x370d0
movq 0x68(%rax), %rsi
leaq 0x1642e(%rip), %rdx     # 0x371c0
callq 0x1ff60
movl -0x4(%rbp), %edi
leaq 0x1632f(%rip), %rax     # 0x370d0
movq 0x68(%rax), %rsi
leaq 0x16414(%rip), %rdx     # 0x371c0
addq $0x8, %rdx
callq 0x1ff60
leaq 0x16414(%rip), %rax     # 0x371d0
leaq 0x1630d(%rip), %rcx     # 0x370d0
movq %rcx, (%rax)
movl -0x4(%rbp), %edi
leaq 0x16410(%rip), %rsi     # 0x371e0
movl $0xa, %edx
callq 0x1f2c0
movl -0x4(%rbp), %edi
leaq 0x1250c(%rip), %rsi     # 0x332f0
callq 0x1c810
movl -0x4(%rbp), %edi
leaq 0x15edd(%rip), %rsi     # 0x36cd0
callq 0x1c810
movl -0x4(%rbp), %edi
leaq 0x15ed2(%rip), %rsi     # 0x36cd4
callq 0x1c810
movl -0x4(%rbp), %edi
leaq 0x15ec7(%rip), %rsi     # 0x36cd8
callq 0x1c810
movl -0x4(%rbp), %edi
leaq 0x124d4(%rip), %rsi     # 0x332f4
callq 0x1c810
movl -0x4(%rbp), %edi
leaq 0x15ead(%rip), %rsi     # 0x36cdc
callq 0x1c810
movl -0x4(%rbp), %edi
leaq 0x1649a(%rip), %rsi     # 0x372d8
callq 0x1c810
movl -0x4(%rbp), %edi
leaq 0x15e97(%rip), %rsi     # 0x36ce4
callq 0x1c810
movl -0x4(%rbp), %edi
leaq 0x15e90(%rip), %rsi     # 0x36cec
callq 0x1c810
movl -0x4(%rbp), %edi
leaq 0x1248d(%rip), %rsi     # 0x332f8
callq 0x1c810
movl -0x4(%rbp), %edi
leaq 0x15e76(%rip), %rsi     # 0x36cf0
callq 0x1c810
movl -0x4(%rbp), %edi
leaq 0x16453(%rip), %rsi     # 0x372dc
callq 0x1c810
movl -0x4(%rbp), %edi
leaq 0x16448(%rip), %rsi     # 0x372e0
callq 0x1c810
movl -0x4(%rbp), %edi
leaq 0x15e4d(%rip), %rsi     # 0x36cf4
callq 0x1c810
movl -0x4(%rbp), %edi
leaq 0x15e42(%rip), %rsi     # 0x36cf8
callq 0x1c810
movl -0x4(%rbp), %edi
leaq 0x15e37(%rip), %rsi     # 0x36cfc
callq 0x1c810
movl -0x4(%rbp), %edi
leaq 0x12428(%rip), %rsi     # 0x332fc
callq 0x1c810
movl -0x4(%rbp), %edi
leaq 0x1241d(%rip), %rsi     # 0x33300
callq 0x1c810
movl -0x4(%rbp), %edi
leaq 0x12412(%rip), %rsi     # 0x33304
callq 0x1c810
movl -0x4(%rbp), %edi
leaq 0x15dff(%rip), %rsi     # 0x36d00
callq 0x1c810
movl -0x4(%rbp), %edi
leaq 0x123f8(%rip), %rsi     # 0x33308
callq 0x1c810
movl -0x4(%rbp), %edi
leaq 0x15de5(%rip), %rsi     # 0x36d04
callq 0x1c810
movl -0x4(%rbp), %edi
leaq 0x163b6(%rip), %rsi     # 0x372e4
callq 0x1c760
movl -0x4(%rbp), %edi
leaq 0x163a8(%rip), %rsi     # 0x372e5
callq 0x1c760
movl -0x4(%rbp), %edi
leaq 0x1639a(%rip), %rsi     # 0x372e6
movl $0xf, %edx
callq 0x1c690
movl -0x4(%rbp), %edi
leaq 0x163a0(%rip), %rsi     # 0x37300
movl $0x50, %edx
callq 0x1c690
movl -0x4(%rbp), %edi
leaq 0x163dc(%rip), %rsi     # 0x37350
movl $0x50, %edx
callq 0x1c690
movl -0x4(%rbp), %edi
leaq 0x16418(%rip), %rsi     # 0x373a0
movl $0x50, %edx
callq 0x1c690
movl -0x4(%rbp), %edi
leaq 0x15d6c(%rip), %rsi     # 0x36d08
callq 0x1c7b0
movl -0x4(%rbp), %edi
leaq 0x15d5e(%rip), %rsi     # 0x36d09
callq 0x1c7b0
movl -0x4(%rbp), %edi
leaq 0x15d50(%rip), %rsi     # 0x36d0a
callq 0x1c7b0
movl -0x4(%rbp), %edi
leaq 0x15d42(%rip), %rsi     # 0x36d0b
callq 0x1c7b0
movl -0x4(%rbp), %edi
leaq 0x15d34(%rip), %rsi     # 0x36d0c
callq 0x1c7b0
movl -0x4(%rbp), %edi
leaq 0x12325(%rip), %rsi     # 0x3330c
callq 0x1c7b0
movl -0x4(%rbp), %edi
leaq -0x5(%rbp), %rsi
callq 0x1c7b0
movl -0x4(%rbp), %edi
leaq 0x1230b(%rip), %rsi     # 0x3330d
callq 0x1c7b0
movl -0x4(%rbp), %edi
leaq 0x15cfd(%rip), %rsi     # 0x36d0e
callq 0x1c7b0
movl -0x4(%rbp), %edi
leaq 0x15cef(%rip), %rsi     # 0x36d0f
callq 0x1c7b0
movl -0x4(%rbp), %edi
leaq 0x15ce1(%rip), %rsi     # 0x36d10
callq 0x1c7b0
movl -0x4(%rbp), %edi
leaq 0x15cd3(%rip), %rsi     # 0x36d11
callq 0x1c7b0
movl -0x4(%rbp), %edi
leaq 0x15cc5(%rip), %rsi     # 0x36d12
callq 0x1c7b0
movl -0x4(%rbp), %edi
leaq 0x15cb7(%rip), %rsi     # 0x36d13
callq 0x1c7b0
movl -0x4(%rbp), %edi
leaq 0x18861(%rip), %rsi     # 0x398cc
callq 0x1d3a0
movl -0x4(%rbp), %edi
leaq 0x1885a(%rip), %rsi     # 0x398d4
callq 0x1d3a0
movl -0x4(%rbp), %edi
leaq 0x18853(%rip), %rsi     # 0x398dc
callq 0x1d3a0
movl -0x4(%rbp), %edi
leaq 0x12318(%rip), %rsi     # 0x333b0
callq 0x1d3a0
movl -0x4(%rbp), %edi
leaq 0x12319(%rip), %rsi     # 0x333c0
movl $0x35, %edx
callq 0x1f500
movl -0x4(%rbp), %edi
leaq 0x18835(%rip), %rsi     # 0x398f0
movl $0x14, %edx
callq 0x1e970
movl -0x4(%rbp), %edi
callq 0x1ffc0
movl -0x4(%rbp), %edi
callq 0x20100
movl -0x4(%rbp), %edi
callq 0x20250
movl -0x4(%rbp), %edi
callq 0x204f0
movl -0x4(%rbp), %edi
leaq 0x13ce1(%rip), %rsi     # 0x34dd0
movl $0x9, %edx
callq 0x1e460
movl -0x4(%rbp), %edi
leaq 0x13d5d(%rip), %rsi     # 0x34e60
movl $0xb, %edx
callq 0x1e460
movl -0x4(%rbp), %edi
leaq 0x13e79(%rip), %rsi     # 0x34f90
movl $0x13, %edx
callq 0x1e460
movl -0x4(%rbp), %edi
leaq 0x141d5(%rip), %rsi     # 0x35300
movl $0x1b, %edx
callq 0x1e460
movl -0x4(%rbp), %edi
leaq 0x14371(%rip), %rsi     # 0x354b0
movl $0x16, %edx
callq 0x1e460
movl -0x4(%rbp), %edi
leaq 0x144bd(%rip), %rsi     # 0x35610
movl $0x1b, %edx
callq 0x1e460
movl -0x4(%rbp), %edi
leaq 0x14659(%rip), %rsi     # 0x357c0
movl $0x1b, %edx
callq 0x1e460
movl -0x4(%rbp), %edi
leaq 0x18cd5(%rip), %rax     # 0x39e50
movq (%rax), %rsi
callq 0x1d510
movl -0x4(%rbp), %edi
leaq 0x18cd3(%rip), %rax     # 0x39e60
movq (%rax), %rsi
callq 0x1d510
movl -0x4(%rbp), %edi
movq 0x11e21(%rip), %rax     # 0x32fc0
movq (%rax), %rsi
callq 0x1d510
xorl %eax, %eax
cmpl $0x0, 0x1b748(%rip)     # 0x3c8f8
movb %al, -0xd(%rbp)
jne 0x211c2
cmpl $0x0, 0x1b734(%rip)     # 0x3c8f0
sete %al
movb %al, -0xd(%rbp)
movb -0xd(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
addq $0x10, %rsp
popq %rbp
retq