// File: /workspace/github_c_makefile_star2_O3/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 %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movl %edi, %ebx
movl $0x0, 0x1a558(%rip)     # 0x33490
leaq 0x146c1(%rip), %rsi     # 0x2d600
movl $0x14, %edx
callq 0x16760
leaq 0x14890(%rip), %rsi     # 0x2d7e0
movl %ebx, %edi
callq 0x15bb9
leaq 0x14952(%rip), %r14     # 0x2d8b0
movl %ebx, %edi
movq %r14, %rsi
movl $0x9, %edx
callq 0x16b15
leaq 0xc(%rsp), %r15
movl %ebx, %edi
movq %r15, %rsi
callq 0x15bb9
movslq (%r15), %rax
imulq $0x68, %rax, %rax
addq %r14, %rax
leaq 0x14ccb(%rip), %rcx     # 0x2dc58
movq %rax, (%rcx)
leaq 0x148a9(%rip), %rsi     # 0x2d840
movl %ebx, %edi
callq 0x1815e
leaq 0x14cbb(%rip), %r14     # 0x2dc60
movl %ebx, %edi
movq %r14, %rsi
callq 0x17e62
leaq 0x14d42(%rip), %rsi     # 0x2dcf8
movl %ebx, %edi
callq 0x17030
leaq 0x14884(%rip), %rsi     # 0x2d848
movl %ebx, %edi
callq 0x1775e
movq 0x68(%r14), %rsi
leaq 0x1487a(%rip), %rdx     # 0x2d850
movl %ebx, %edi
callq 0x18286
movq 0x68(%r14), %rsi
leaq 0x14870(%rip), %rdx     # 0x2d858
movl %ebx, %edi
callq 0x18286
movq 0x68(%r14), %rsi
leaq 0x14d56(%rip), %r15     # 0x2dd50
movl %ebx, %edi
movq %r15, %rdx
callq 0x18286
movq 0x68(%r14), %rsi
addq $0x8, %r15
movl %ebx, %edi
movq %r15, %rdx
callq 0x18286
leaq 0x14d43(%rip), %rax     # 0x2dd60
movq %r14, (%rax)
leaq 0x14d49(%rip), %rsi     # 0x2dd70
movl %ebx, %edi
movl $0xa, %edx
callq 0x1796c
leaq 0x112b6(%rip), %rsi     # 0x2a2f0
movl %ebx, %edi
callq 0x15bb9
leaq 0x14818(%rip), %rsi     # 0x2d860
movl %ebx, %edi
callq 0x15bb9
leaq 0x1480e(%rip), %rsi     # 0x2d864
movl %ebx, %edi
callq 0x15bb9
leaq 0x14804(%rip), %rsi     # 0x2d868
movl %ebx, %edi
callq 0x15bb9
leaq 0x11282(%rip), %rsi     # 0x2a2f4
movl %ebx, %edi
callq 0x15bb9
leaq 0x147ec(%rip), %rsi     # 0x2d86c
movl %ebx, %edi
callq 0x15bb9
leaq 0x14dda(%rip), %rsi     # 0x2de68
movl %ebx, %edi
callq 0x15bb9
leaq 0x147d8(%rip), %rsi     # 0x2d874
movl %ebx, %edi
callq 0x15bb9
leaq 0x147d2(%rip), %rsi     # 0x2d87c
movl %ebx, %edi
callq 0x15bb9
leaq 0x11240(%rip), %rsi     # 0x2a2f8
movl %ebx, %edi
callq 0x15bb9
leaq 0x147ba(%rip), %rsi     # 0x2d880
movl %ebx, %edi
callq 0x15bb9
leaq 0x14d98(%rip), %rsi     # 0x2de6c
movl %ebx, %edi
callq 0x15bb9
leaq 0x14d8e(%rip), %rsi     # 0x2de70
movl %ebx, %edi
callq 0x15bb9
leaq 0x14794(%rip), %rsi     # 0x2d884
movl %ebx, %edi
callq 0x15bb9
leaq 0x1478a(%rip), %rsi     # 0x2d888
movl %ebx, %edi
callq 0x15bb9
leaq 0x14780(%rip), %rsi     # 0x2d88c
movl %ebx, %edi
callq 0x15bb9
leaq 0x111e2(%rip), %rsi     # 0x2a2fc
movl %ebx, %edi
callq 0x15bb9
leaq 0x111d8(%rip), %rsi     # 0x2a300
movl %ebx, %edi
callq 0x15bb9
leaq 0x111ce(%rip), %rsi     # 0x2a304
movl %ebx, %edi
callq 0x15bb9
leaq 0x1474c(%rip), %rsi     # 0x2d890
movl %ebx, %edi
callq 0x15bb9
leaq 0x111b6(%rip), %rsi     # 0x2a308
movl %ebx, %edi
callq 0x15bb9
leaq 0x14734(%rip), %rsi     # 0x2d894
movl %ebx, %edi
callq 0x15bb9
leaq 0x14d06(%rip), %rsi     # 0x2de74
movl %ebx, %edi
movl $0x1, %edx
callq 0x15ade
leaq 0x14cf4(%rip), %rsi     # 0x2de75
movl %ebx, %edi
movl $0x1, %edx
callq 0x15ade
leaq 0x14ce2(%rip), %rsi     # 0x2de76
movl %ebx, %edi
movl $0xf, %edx
callq 0x15ade
leaq 0x14ce9(%rip), %rsi     # 0x2de90
movl %ebx, %edi
movl $0x50, %edx
callq 0x15ade
leaq 0x14d26(%rip), %rsi     # 0x2dee0
movl %ebx, %edi
movl $0x50, %edx
callq 0x15ade
leaq 0x14d63(%rip), %rsi     # 0x2df30
movl %ebx, %edi
movl $0x50, %edx
callq 0x15ade
leaq 0xc(%rsp), %r14
movl %ebx, %edi
movq %r14, %rsi
movl $0x1, %edx
callq 0x15ade
cmpb $0x0, (%r14)
leaq 0x146a0(%rip), %rax     # 0x2d898
setne (%rax)
leaq 0xc(%rsp), %r14
movl %ebx, %edi
movq %r14, %rsi
movl $0x1, %edx
callq 0x15ade
cmpb $0x0, (%r14)
leaq 0x1467f(%rip), %rax     # 0x2d899
setne (%rax)
leaq 0xc(%rsp), %r14
movl %ebx, %edi
movq %r14, %rsi
movl $0x1, %edx
callq 0x15ade
cmpb $0x0, (%r14)
leaq 0x1465e(%rip), %rax     # 0x2d89a
setne (%rax)
leaq 0xc(%rsp), %r14
movl %ebx, %edi
movq %r14, %rsi
movl $0x1, %edx
callq 0x15ade
cmpb $0x0, (%r14)
leaq 0x1463d(%rip), %rax     # 0x2d89b
setne (%rax)
leaq 0xc(%rsp), %r14
movl %ebx, %edi
movq %r14, %rsi
movl $0x1, %edx
callq 0x15ade
cmpb $0x0, (%r14)
leaq 0x1461c(%rip), %rax     # 0x2d89c
setne (%rax)
leaq 0xc(%rsp), %r14
movl %ebx, %edi
movq %r14, %rsi
movl $0x1, %edx
callq 0x15ade
cmpb $0x0, (%r14)
leaq 0x1106a(%rip), %rax     # 0x2a30c
setne (%rax)
leaq 0xc(%rsp), %rsi
movl %ebx, %edi
movl $0x1, %edx
callq 0x15ade
leaq 0xc(%rsp), %r14
movl %ebx, %edi
movq %r14, %rsi
movl $0x1, %edx
callq 0x15ade
cmpb $0x0, (%r14)
leaq 0x11038(%rip), %rax     # 0x2a30d
setne (%rax)
leaq 0xc(%rsp), %r14
movl %ebx, %edi
movq %r14, %rsi
movl $0x1, %edx
callq 0x15ade
cmpb $0x0, (%r14)
leaq 0x145a7(%rip), %rax     # 0x2d89e
setne (%rax)
leaq 0xc(%rsp), %r14
movl %ebx, %edi
movq %r14, %rsi
movl $0x1, %edx
callq 0x15ade
cmpb $0x0, (%r14)
leaq 0x14586(%rip), %rax     # 0x2d89f
setne (%rax)
leaq 0xc(%rsp), %r14
movl %ebx, %edi
movq %r14, %rsi
movl $0x1, %edx
callq 0x15ade
cmpb $0x0, (%r14)
leaq 0x14565(%rip), %rax     # 0x2d8a0
setne (%rax)
leaq 0xc(%rsp), %r14
movl %ebx, %edi
movq %r14, %rsi
movl $0x1, %edx
callq 0x15ade
cmpb $0x0, (%r14)
leaq 0x14544(%rip), %rax     # 0x2d8a1
setne (%rax)
leaq 0xc(%rsp), %r14
movl %ebx, %edi
movq %r14, %rsi
movl $0x1, %edx
callq 0x15ade
cmpb $0x0, (%r14)
leaq 0x14523(%rip), %rax     # 0x2d8a2
setne (%rax)
leaq 0xc(%rsp), %r14
movl %ebx, %edi
movq %r14, %rsi
movl $0x1, %edx
callq 0x15ade
cmpb $0x0, (%r14)
leaq 0x14502(%rip), %rax     # 0x2d8a3
setne (%rax)
leaq 0x170b1(%rip), %r14     # 0x3045c
movl %ebx, %edi
movq %r14, %rsi
callq 0x15bb9
addq $0x4, %r14
movl %ebx, %edi
movq %r14, %rsi
callq 0x15bb9
leaq 0x1709a(%rip), %r14     # 0x30464
movl %ebx, %edi
movq %r14, %rsi
callq 0x15bb9
addq $0x4, %r14
movl %ebx, %edi
movq %r14, %rsi
callq 0x15bb9
leaq 0x17083(%rip), %r14     # 0x3046c
movl %ebx, %edi
movq %r14, %rsi
callq 0x15bb9
addq $0x4, %r14
movl %ebx, %edi
movq %r14, %rsi
callq 0x15bb9
leaq 0x10fa8(%rip), %r14     # 0x2a3b0
movl %ebx, %edi
movq %r14, %rsi
callq 0x15bb9
addq $0x4, %r14
movl %ebx, %edi
movq %r14, %rsi
callq 0x15bb9
leaq 0x10f99(%rip), %rsi     # 0x2a3c0
movl %ebx, %edi
callq 0x17ada
leaq 0x1704b(%rip), %rsi     # 0x30480
movl %ebx, %edi
movl $0x14, %edx
callq 0x171d4
movl %ebx, %edi
callq 0x182d9
movl %ebx, %edi
callq 0x183e8
movl %ebx, %edi
callq 0x18519
movl %ebx, %edi
callq 0x1874e
leaq 0x1296c(%rip), %rsi     # 0x2bdd0
movl %ebx, %edi
movl $0x9, %edx
callq 0x16e31
leaq 0x129e9(%rip), %rsi     # 0x2be60
movl %ebx, %edi
movl $0xb, %edx
callq 0x16e31
leaq 0x12b06(%rip), %rsi     # 0x2bf90
movl %ebx, %edi
movl $0x13, %edx
callq 0x16e31
leaq 0x12e63(%rip), %rsi     # 0x2c300
movl %ebx, %edi
movl $0x1b, %edx
callq 0x16e31
leaq 0x13000(%rip), %rsi     # 0x2c4b0
movl %ebx, %edi
movl $0x16, %edx
callq 0x16e31
leaq 0x1314d(%rip), %rsi     # 0x2c610
movl %ebx, %edi
movl $0x1b, %edx
callq 0x16e31
leaq 0x132ea(%rip), %rsi     # 0x2c7c0
movl %ebx, %edi
movl $0x1b, %edx
callq 0x16e31
leaq 0x174f7(%rip), %rax     # 0x309e0
movq (%rax), %rsi
movl %ebx, %edi
callq 0x1643d
leaq 0x174f6(%rip), %rax     # 0x309f0
movq (%rax), %rsi
movl %ebx, %edi
callq 0x1643d
movq 0x10a25(%rip), %rax     # 0x29f30
movq (%rax), %rsi
movl %ebx, %edi
callq 0x1643d
movl 0x19f65(%rip), %ecx     # 0x33480
xorl %eax, %eax
orl 0x19f65(%rip), %ecx     # 0x33488
sete %al
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq