// File: /workspace/github_c_makefile_star2_O0/rafa9811[P]theIndiependenceGame/m_background.c
// Function: main
int main(int argc, char const *argv[]) {
Inventory *shop,*in;
Stat *stat;
short x;
char name[256],*roomdraw,dial[1024],nextq[1024];
Map *map;
Mobjects *mobj;
Object * obj;
int err;
Player *c;
Meeting *meeting;
Dialogs *dialog;

obj=object_ini();
stat=stat_ini ();
c=player_ini();

/*funciones de inventory*/

in = inventory_load("inventory.txt");
if (!in) fprintf(stderr, "Error in loading the inventory");

err= inventory_erase(in, 1);
if (err==-1) fprintf(stderr, "Error in erasing the object in the inventory");

err= inventory_erase(in,1);

obj=inventory_get(in,0);
if (!obj) fprintf(stderr, "Error in inventory get");

x=inventory_full(in);
if (x==-1) fprintf(stderr, "Error in inventory full: error en los parametros de entrada");
if (x==1) fprintf(stderr, "Error in inventory full: the inventory is full");

in=inventory_insert(in, obj);
if (!in) fprintf(stderr, "Error in inventory insert");


/*funciones de shop*/

shop = inventory_load("shop.txt");
if (!shop) fprintf(stderr, "Error in loading the shop");

x=bg_buy(shop, in, stat, 2, name);
if(x==0)fprintf(stderr, "Error no money");
if(x==-1)fprintf(stderr, "Error in function");


/*funciones de map*/

map=map_load ("map.txt");
if (!map) fprintf(stderr, "Error in loading the map");

roomdraw=map_getRoomDraw (map, 23);
if (!roomdraw) fprintf(stderr, "Error in drawing the room");

printScreen(roomdraw);

/*funciones de objects*/

mobj=mobjects_load("objects.txt");
if (!mobj) fprintf(stderr, "Error in loading the mobjects");

err=mobjects_insert(mobj, obj);
if (err==-1) fprintf(stderr, "Error in inserting the object in mboject");

err=mobjects_search(mobj, 12, 4, 5);
if (err==-1) fprintf(stderr, "Error in searching the object in mboject");

obj=mobjects_get(mobj, 14, 0);
if (!obj) fprintf(stderr, "Error in getting the object in mboject");

mobj= mobjects_erase(mobj, 3, 1);
if (!mobj) fprintf(stderr, "Error in erasing an element of the mobjects");

/*funciones de background*/
err=bg_updateRoom(mobj, map, c);
if(err==-1) fprintf(stderr, "Error in updateRoom");

roomdraw=map_getRoomDraw (map, 0);
if (!roomdraw) fprintf(stderr, "Error in drawing the room");

printScreen(roomdraw);


x=bg_checkDanger(map, c, stat);
if (x==-1) fprintf(stderr, "Error in checking danger");

err=bg_pick(in, c, mobj, name,map);
if(err==-1) fprintf(stderr, "Error in background pick");

err= bg_use(in, stat, 0, name,&err);
if(err==-1)  fprintf(stderr, "Error in background use");
if(err==0)  fprintf(stderr, "There are no more uses for the object");

meeting = meeting_load("meetings.txt");
dialog = dialogs_load("dialogs.txt");
/*Meeting*/
/*lo que falta de bg*/
err=bg_talk(dialog, c, mobj, dial, name);
if (err==-1) fprintf(stderr, "Error in background talk");

err= bg_meeting(meeting, c, mobj, stat, 1, 2, nextq,&err);
if (err==-1) fprintf(stderr, "Error in background meeting");

return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x990, %rsp            # imm = 0x990
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movb $0x0, %al
callq 0x3e40
movq %rax, -0x958(%rbp)
movb $0x0, %al
callq 0x56e0
movq %rax, -0x28(%rbp)
movb $0x0, %al
callq 0x4f00
movq %rax, -0x968(%rbp)
leaq 0x6c9d(%rip), %rdi      # 0x8004
callq 0x1ba0
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x138f
movq 0xac7a(%rip), %rax      # 0xbff8
movq (%rax), %rdi
leaq 0x6c8a(%rip), %rsi      # 0x8012
movb $0x0, %al
callq 0x10e0
movq -0x20(%rbp), %rdi
movl $0x1, %esi
callq 0x1ed0
movl %eax, -0x95c(%rbp)
cmpl $-0x1, -0x95c(%rbp)
jne 0x13c4
movq 0xac45(%rip), %rax      # 0xbff8
movq (%rax), %rdi
leaq 0x6c74(%rip), %rsi      # 0x8031
movb $0x0, %al
callq 0x10e0
movq -0x20(%rbp), %rdi
movl $0x1, %esi
callq 0x1ed0
movl %eax, -0x95c(%rbp)
movq -0x20(%rbp), %rdi
xorl %esi, %esi
callq 0x2010
movq %rax, -0x958(%rbp)
cmpq $0x0, -0x958(%rbp)
jne 0x140c
movq 0xabfd(%rip), %rax      # 0xbff8
movq (%rax), %rdi
leaq 0x6c59(%rip), %rsi      # 0x805e
movb $0x0, %al
callq 0x10e0
movq -0x20(%rbp), %rdi
callq 0x20c0
movw %ax, -0x2a(%rbp)
movswl -0x2a(%rbp), %eax
cmpl $-0x1, %eax
jne 0x143a
movq 0xabcf(%rip), %rax      # 0xbff8
movq (%rax), %rdi
leaq 0x6c42(%rip), %rsi      # 0x8075
movb $0x0, %al
callq 0x10e0
movswl -0x2a(%rbp), %eax
cmpl $0x1, %eax
jne 0x145b
movq 0xabae(%rip), %rax      # 0xbff8
movq (%rax), %rdi
leaq 0x6c5d(%rip), %rsi      # 0x80b1
movb $0x0, %al
callq 0x10e0
movq -0x20(%rbp), %rdi
movq -0x958(%rbp), %rsi
callq 0x2050
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x148e
movq 0xab7b(%rip), %rax      # 0xbff8
movq (%rax), %rdi
leaq 0x6c59(%rip), %rsi      # 0x80e0
movb $0x0, %al
callq 0x10e0
leaq 0x6c65(%rip), %rdi      # 0x80fa
callq 0x1ba0
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x14bd
movq 0xab4c(%rip), %rax      # 0xbff8
movq (%rax), %rdi
leaq 0x6c4d(%rip), %rsi      # 0x8103
movb $0x0, %al
callq 0x10e0
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x28(%rbp), %rdx
leaq -0x130(%rbp), %r8
movl $0x2, %ecx
callq 0x3a40
movw %ax, -0x2a(%rbp)
movswl -0x2a(%rbp), %eax
cmpl $0x0, %eax
jne 0x14ff
movq 0xab0a(%rip), %rax      # 0xbff8
movq (%rax), %rdi
leaq 0x6c25(%rip), %rsi      # 0x811d
movb $0x0, %al
callq 0x10e0
movswl -0x2a(%rbp), %eax
cmpl $-0x1, %eax
jne 0x1520
movq 0xaae9(%rip), %rax      # 0xbff8
movq (%rax), %rdi
leaq 0x6c13(%rip), %rsi      # 0x812c
movb $0x0, %al
callq 0x10e0
leaq 0x6c17(%rip), %rdi      # 0x813e
callq 0x2930
movq %rax, -0x948(%rbp)
cmpq $0x0, -0x948(%rbp)
jne 0x1555
movq 0xaab4(%rip), %rax      # 0xbff8
movq (%rax), %rdi
leaq 0x6bf8(%rip), %rsi      # 0x8146
movb $0x0, %al
callq 0x10e0
movq -0x948(%rbp), %rdi
movl $0x17, %esi
callq 0x2bc0
movq %rax, -0x138(%rbp)
cmpq $0x0, -0x138(%rbp)
jne 0x158f
movq 0xaa7a(%rip), %rax      # 0xbff8
movq (%rax), %rdi
leaq 0x6bd7(%rip), %rsi      # 0x815f
movb $0x0, %al
callq 0x10e0
movq -0x138(%rbp), %rdi
callq 0x1270
leaq 0x6bd7(%rip), %rdi      # 0x8179
callq 0x21b0
movq %rax, -0x950(%rbp)
cmpq $0x0, -0x950(%rbp)
jne 0x15d0
movq 0xaa39(%rip), %rax      # 0xbff8
movq (%rax), %rdi
leaq 0x6bbc(%rip), %rsi      # 0x8185
movb $0x0, %al
callq 0x10e0
movq -0x950(%rbp), %rdi
movq -0x958(%rbp), %rsi
callq 0x24e0
movl %eax, -0x95c(%rbp)
cmpl $-0x1, -0x95c(%rbp)
jne 0x160a
movq 0xa9ff(%rip), %rax      # 0xbff8
movq (%rax), %rdi
leaq 0x6ba0(%rip), %rsi      # 0x81a3
movb $0x0, %al
callq 0x10e0
movq -0x950(%rbp), %rdi
movl $0xc, %esi
movl $0x4, %edx
movl $0x5, %ecx
callq 0x25a0
movl %eax, -0x95c(%rbp)
cmpl $-0x1, -0x95c(%rbp)
jne 0x164c
movq 0xa9bd(%rip), %rax      # 0xbff8
movq (%rax), %rdi
leaq 0x6b87(%rip), %rsi      # 0x81cc
movb $0x0, %al
callq 0x10e0
movq -0x950(%rbp), %rdi
movl $0xe, %esi
xorl %edx, %edx
callq 0x2730
movq %rax, -0x958(%rbp)
cmpq $0x0, -0x958(%rbp)
jne 0x1688
movq 0xa981(%rip), %rax      # 0xbff8
movq (%rax), %rdi
leaq 0x6b74(%rip), %rsi      # 0x81f5
movb $0x0, %al
callq 0x10e0
movq -0x950(%rbp), %rdi
movl $0x3, %esi
movl $0x1, %edx
callq 0x2780
movq %rax, -0x950(%rbp)
cmpq $0x0, -0x950(%rbp)
jne 0x16c7
movq 0xa942(%rip), %rax      # 0xbff8
movq (%rax), %rdi
leaq 0x6b5c(%rip), %rsi      # 0x821c
movb $0x0, %al
callq 0x10e0
movq -0x950(%rbp), %rdi
movq -0x948(%rbp), %rsi
movq -0x968(%rbp), %rdx
callq 0x3230
movl %eax, -0x95c(%rbp)
cmpl $-0x1, -0x95c(%rbp)
jne 0x1708
movq 0xa901(%rip), %rax      # 0xbff8
movq (%rax), %rdi
leaq 0x6b47(%rip), %rsi      # 0x8248
movb $0x0, %al
callq 0x10e0
movq -0x948(%rbp), %rdi
xorl %esi, %esi
callq 0x2bc0
movq %rax, -0x138(%rbp)
cmpq $0x0, -0x138(%rbp)
jne 0x173f
movq 0xa8ca(%rip), %rax      # 0xbff8
movq (%rax), %rdi
leaq 0x6a27(%rip), %rsi      # 0x815f
movb $0x0, %al
callq 0x10e0
movq -0x138(%rbp), %rdi
callq 0x1270
movq -0x948(%rbp), %rdi
movq -0x968(%rbp), %rsi
movq -0x28(%rbp), %rdx
callq 0x34c0
movw %ax, -0x2a(%rbp)
movswl -0x2a(%rbp), %eax
cmpl $-0x1, %eax
jne 0x1787
movq 0xa882(%rip), %rax      # 0xbff8
movq (%rax), %rdi
leaq 0x6adc(%rip), %rsi      # 0x825c
movb $0x0, %al
callq 0x10e0
movq -0x20(%rbp), %rdi
movq -0x968(%rbp), %rsi
movq -0x950(%rbp), %rdx
leaq -0x130(%rbp), %rcx
movq -0x948(%rbp), %r8
callq 0x3560
movl %eax, -0x95c(%rbp)
cmpl $-0x1, -0x95c(%rbp)
jne 0x17d3
movq 0xa836(%rip), %rax      # 0xbff8
movq (%rax), %rdi
leaq 0x6aa9(%rip), %rsi      # 0x8275
movb $0x0, %al
callq 0x10e0
movq -0x20(%rbp), %rdi
movq -0x28(%rbp), %rsi
leaq -0x130(%rbp), %rcx
xorl %edx, %edx
leaq -0x95c(%rbp), %r8
callq 0x38a0
movl %eax, -0x95c(%rbp)
cmpl $-0x1, -0x95c(%rbp)
jne 0x1817
movq 0xa7f2(%rip), %rax      # 0xbff8
movq (%rax), %rdi
leaq 0x6a7e(%rip), %rsi      # 0x828e
movb $0x0, %al
callq 0x10e0
cmpl $0x0, -0x95c(%rbp)
jne 0x1838
movq 0xa7d1(%rip), %rax      # 0xbff8
movq (%rax), %rdi
leaq 0x6a75(%rip), %rsi      # 0x82a6
movb $0x0, %al
callq 0x10e0
leaq 0x6a8d(%rip), %rdi      # 0x82cc
callq 0x2cc0
movq %rax, -0x970(%rbp)
leaq 0x6a87(%rip), %rdi      # 0x82d9
callq 0x19d0
movq %rax, -0x978(%rbp)
movq -0x978(%rbp), %rdi
movq -0x968(%rbp), %rsi
movq -0x950(%rbp), %rdx
leaq -0x540(%rbp), %rcx
leaq -0x130(%rbp), %r8
callq 0x3b60
movl %eax, -0x95c(%rbp)
cmpl $-0x1, -0x95c(%rbp)
jne 0x18ad
movq 0xa75c(%rip), %rax      # 0xbff8
movq (%rax), %rdi
leaq 0x6a3f(%rip), %rsi      # 0x82e5
movb $0x0, %al
callq 0x10e0
movq -0x970(%rbp), %rdi
movq -0x968(%rbp), %rsi
movq -0x950(%rbp), %rdx
movq -0x28(%rbp), %rcx
leaq -0x940(%rbp), %r10
movl $0x1, %r8d
movl $0x2, %r9d
leaq -0x95c(%rbp), %rax
movq %r10, (%rsp)
movq %rax, 0x8(%rsp)
callq 0x3c90
movl %eax, -0x95c(%rbp)
cmpl $-0x1, -0x95c(%rbp)
jne 0x1915
movq 0xa6f4(%rip), %rax      # 0xbff8
movq (%rax), %rdi
leaq 0x69f0(%rip), %rsi      # 0x82fe
movb $0x0, %al
callq 0x10e0
xorl %eax, %eax
addq $0x990, %rsp            # imm = 0x990
popq %rbp
retq