// File: /workspace/github_c_makefile_star2_O3/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 0x2653
movq %rdi, %r14
movl $0x820, %edi            # imm = 0x820
callq 0x1130
testq %rax, %rax
je 0x2653
movq %rax, %r13
leaq 0x3bbc(%rip), %rsi      # 0x603a
movq %r14, %rdi
callq 0x1190
testq %rax, %rax
je 0x264b
movq %rax, %r14
xorl %eax, %eax
callq 0x37f8
testq %rax, %rax
je 0x2643
movq %rax, %r15
movq %r14, %rdi
callq 0x10f0
testl %eax, %eax
jne 0x2631
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 0x3c48(%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 0x266b
movq %r15, %rdi
movq %rbp, %rsi
callq 0x3867
movl 0x2c(%rsp), %esi
movq %r15, %rdi
callq 0x388c
movswl 0x4(%rsp), %esi
movq %r15, %rdi
callq 0x3898
movl 0x28(%rsp), %esi
movl 0x24(%rsp), %edx
movq %r15, %rdi
callq 0x38b3
movswl 0xe(%rsp), %esi
movq %r15, %rdi
callq 0x38d3
movswl 0x8(%rsp), %esi
movq %r15, %rdi
callq 0x38ef
movswl 0xc(%rsp), %esi
movq %r15, %rdi
callq 0x390b
movswl 0xa(%rsp), %esi
movq %r15, %rdi
callq 0x3927
movl 0x20(%rsp), %esi
movq %r15, %rdi
callq 0x3943
movl 0x1c(%rsp), %esi
movq %r15, %rdi
callq 0x395d
movl 0x18(%rsp), %esi
movq %r15, %rdi
callq 0x3969
movl 0x14(%rsp), %esi
movq %r15, %rdi
callq 0x3975
movl 0x10(%rsp), %esi
movq %r15, %rdi
callq 0x3981
movslq 0x4(%rsp), %rax
shlq $0x4, %rax
leaq (%rax,%rax,4), %rax
movq %r13, %rbx
cmpq $0x0, (%rbx,%rax)
leaq 0x8(%rbx), %rbx
jne 0x25fc
movq %r15, %rdi
callq 0x3a5c
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 0x24c2
movq %r15, %rdi
callq 0x3847
movq %r14, %rdi
callq 0x1070
jmp 0x2656
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