// File: /workspace/github_c_makefile_star2_O2/rafa9811[P]theIndiependenceGame/background.c
// Function: mobjects_load
Mobjects* mobjects_load(char*filename){
    Object* Oaux;
	Mobjects* m;
	FILE *in;
	int i;

	char name[256],buff[1024];
	int id,roomid,px,py,uses,motivation,danger,chaos,money;
	short npc,ispick,onoff,meeting;

	if(!filename) return NULL;

	m=(Mobjects*)malloc(sizeof(Mobjects));
	if(!m) return NULL;
	in = (FILE*) fopen(filename, "r");
	if(!in){
		free(m);
		return NULL;
	}

    Oaux=object_ini();
    if(!Oaux){
		fclose(in);
		free(m);
		return NULL;
	}

  while(!feof(in)){
		fgets(buff,1024,in);
		if(14 != sscanf(buff,"%[^\t]%d\t%d\t%d\t%d\t%hd\t%hd\t%hd\t%hd\t%d\t%d\t%d\t%d\t%d",name,&id,&roomid,&px,&py,&npc,&meeting,&ispick,&onoff,&uses,&motivation,&danger,&chaos,&money)) exit(-1);
		object_setName(Oaux,name);
    object_setId(Oaux,id);
    object_setRoomId(Oaux,roomid);
    object_setPosition(Oaux,px,py);
    object_setNPC(Oaux,npc);
		object_setMeeting(Oaux,meeting);
    object_setIsPick(Oaux,ispick);
    object_setOnOff(Oaux,onoff);
    object_setUses(Oaux,uses);
    object_setMotivation(Oaux,motivation);
    object_setDanger(Oaux,danger);
    object_setChaos(Oaux,chaos);
    object_setMoney(Oaux,money);
		for(i=0;m->objs[roomid][i]!=NULL;i++);
		m->objs[roomid][i]=object_copy(Oaux);
  }

	object_destroy(Oaux);
	fclose(in);

	return(m);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x538, %rsp            # imm = 0x538
testq %rdi, %rdi
je 0x24ce
movq %rdi, %r14
movl $0x820, %edi            # imm = 0x820
callq 0x1130
testq %rax, %rax
je 0x24ce
movq %rax, %r13
leaq 0x3d2e(%rip), %rsi      # 0x603a
movq %r14, %rdi
callq 0x11a0
testq %rax, %rax
je 0x24c6
movq %rax, %r14
xorl %eax, %eax
callq 0x35c0
testq %rax, %rax
je 0x24be
movq %rax, %r15
leaq 0x130(%rsp), %r12
leaq 0x30(%rsp), %rbp
movq %r14, %rdi
callq 0x10f0
testl %eax, %eax
jne 0x24ac
movq %r12, %rdi
movl $0x400, %esi            # imm = 0x400
movq %r14, %rdx
callq 0x10e0
movq %r12, %rdi
leaq 0x3dba(%rip), %rsi      # 0x6124
movq %rbp, %rdx
leaq 0x2c(%rsp), %rcx
leaq 0x4(%rsp), %r8
leaq 0x28(%rsp), %r9
xorl %eax, %eax
leaq 0x10(%rsp), %r10
pushq %r10
leaq 0x1c(%rsp), %r10
pushq %r10
leaq 0x28(%rsp), %r10
pushq %r10
leaq 0x34(%rsp), %r10
pushq %r10
leaq 0x40(%rsp), %r10
pushq %r10
leaq 0x32(%rsp), %r10
pushq %r10
leaq 0x3c(%rsp), %r10
pushq %r10
leaq 0x40(%rsp), %r10
pushq %r10
leaq 0x4e(%rsp), %r10
pushq %r10
leaq 0x6c(%rsp), %r10
pushq %r10
callq 0x1150
addq $0x50, %rsp
cmpl $0xe, %eax
jne 0x24e6
movq %r15, %rdi
movq %rbp, %rsi
callq 0x3627
movl 0x2c(%rsp), %esi
movq %r15, %rdi
callq 0x364c
movswl 0x4(%rsp), %esi
movq %r15, %rdi
callq 0x3658
movl 0x28(%rsp), %esi
movl 0x24(%rsp), %edx
movq %r15, %rdi
callq 0x3673
movswl 0xe(%rsp), %esi
movq %r15, %rdi
callq 0x3693
movswl 0x8(%rsp), %esi
movq %r15, %rdi
callq 0x36af
movswl 0xc(%rsp), %esi
movq %r15, %rdi
callq 0x36cb
movswl 0xa(%rsp), %esi
movq %r15, %rdi
callq 0x36e7
movl 0x20(%rsp), %esi
movq %r15, %rdi
callq 0x3703
movl 0x1c(%rsp), %esi
movq %r15, %rdi
callq 0x371d
movl 0x18(%rsp), %esi
movq %r15, %rdi
callq 0x3729
movl 0x14(%rsp), %esi
movq %r15, %rdi
callq 0x3735
movl 0x10(%rsp), %esi
movq %r15, %rdi
callq 0x3741
movslq 0x4(%rsp), %rax
imulq $0x50, %rax, %rax
movq %r13, %rbx
cmpq $0x0, (%rbx,%rax)
leaq 0x8(%rbx), %rbx
jne 0x2486
movq %r15, %rdi
callq 0x380c
movslq 0x4(%rsp), %rcx
imulq $0x50, %rcx, %rcx
movq %rax, -0x8(%rbx,%rcx)
jmp 0x2340
movq %r15, %rdi
callq 0x360c
movq %r14, %rdi
callq 0x1070
jmp 0x24d1
movq %r14, %rdi
callq 0x1070
movq %r13, %rdi
callq 0x1030
xorl %r13d, %r13d
movq %r13, %rax
addq $0x538, %rsp            # imm = 0x538
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $-0x1
popq %rdi
callq 0x11c0