// File: /workspace/github_c_makefile_star2_O1/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 0x2633
movq %rdi, %r14
movl $0x820, %edi            # imm = 0x820
callq 0x1130
testq %rax, %rax
je 0x2633
movq %rax, %r13
leaq 0x3bdc(%rip), %rsi      # 0x603a
movq %r14, %rdi
callq 0x1190
testq %rax, %rax
je 0x262b
movq %rax, %r14
xorl %eax, %eax
callq 0x37bc
testq %rax, %rax
je 0x2623
movq %rax, %r15
movq %r14, %rdi
callq 0x10f0
testl %eax, %eax
jne 0x2611
leaq 0x130(%rsp), %r12
leaq 0x30(%rsp), %rbp
movq %r12, %rdi
movl $0x400, %esi            # imm = 0x400
movq %r14, %rdx
callq 0x10e0
movq %r12, %rdi
leaq 0x3c68(%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 0x264b
movq %r15, %rdi
movq %rbp, %rsi
callq 0x382b
movl 0x2c(%rsp), %esi
movq %r15, %rdi
callq 0x3850
movswl 0x4(%rsp), %esi
movq %r15, %rdi
callq 0x385f
movl 0x28(%rsp), %esi
movl 0x24(%rsp), %edx
movq %r15, %rdi
callq 0x387a
movswl 0xe(%rsp), %esi
movq %r15, %rdi
callq 0x389a
movswl 0x8(%rsp), %esi
movq %r15, %rdi
callq 0x38b6
movswl 0xc(%rsp), %esi
movq %r15, %rdi
callq 0x38d2
movswl 0xa(%rsp), %esi
movq %r15, %rdi
callq 0x38ee
movl 0x20(%rsp), %esi
movq %r15, %rdi
callq 0x390a
movl 0x1c(%rsp), %esi
movq %r15, %rdi
callq 0x3924
movl 0x18(%rsp), %esi
movq %r15, %rdi
callq 0x3933
movl 0x14(%rsp), %esi
movq %r15, %rdi
callq 0x3942
movl 0x10(%rsp), %esi
movq %r15, %rdi
callq 0x3951
movslq 0x4(%rsp), %rax
shlq $0x4, %rax
leaq (%rax,%rax,4), %rax
movq %r13, %rbx
cmpq $0x0, (%rbx,%rax)
leaq 0x8(%rbx), %rbx
jne 0x25dc
movq %r15, %rdi
callq 0x3a2f
movslq 0x4(%rsp), %rcx
leaq (%rcx,%rcx,4), %rcx
shlq $0x4, %rcx
movq %rax, -0x8(%rbx,%rcx)
movq %r14, %rdi
callq 0x10f0
testl %eax, %eax
je 0x24a2
movq %r15, %rdi
callq 0x380b
movq %r14, %rdi
callq 0x1070
jmp 0x2636
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
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x11b0