// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x5d8, %rsp            # imm = 0x5D8
movq %rdi, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
jne 0x2aac
movq $0x0, -0x30(%rbp)
jmp 0x2d8f
movl $0x820, %edi            # imm = 0x820
callq 0x1130
movq %rax, -0x48(%rbp)
cmpq $0x0, -0x48(%rbp)
jne 0x2ace
movq $0x0, -0x30(%rbp)
jmp 0x2d8f
movq -0x38(%rbp), %rdi
leaq 0x6559(%rip), %rsi      # 0x9032
callq 0x1190
movq %rax, -0x50(%rbp)
cmpq $0x0, -0x50(%rbp)
jne 0x2aff
movq -0x48(%rbp), %rdi
callq 0x1030
movq $0x0, -0x30(%rbp)
jmp 0x2d8f
movb $0x0, %al
callq 0x4710
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x40(%rbp)
jne 0x2b30
movq -0x50(%rbp), %rdi
callq 0x1060
movq -0x48(%rbp), %rdi
callq 0x1030
movq $0x0, -0x30(%rbp)
jmp 0x2d8f
jmp 0x2b32
movq -0x50(%rbp), %rdi
callq 0x10f0
cmpl $0x0, %eax
setne %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x2b4c
jmp 0x2d75
leaq -0x560(%rbp), %rdi
movq -0x50(%rbp), %rdx
movl $0x400, %esi            # imm = 0x400
callq 0x10d0
leaq -0x560(%rbp), %rdi
leaq -0x160(%rbp), %rdx
leaq 0x65a6(%rip), %rsi      # 0x911c
leaq -0x564(%rbp), %rcx
leaq -0x568(%rbp), %r8
leaq -0x56c(%rbp), %r9
leaq -0x570(%rbp), %rax
movq %rax, -0x5a8(%rbp)
leaq -0x586(%rbp), %rax
movq %rax, -0x5a0(%rbp)
leaq -0x58c(%rbp), %r13
leaq -0x588(%rbp), %r12
leaq -0x58a(%rbp), %r15
leaq -0x574(%rbp), %r14
leaq -0x578(%rbp), %rbx
leaq -0x57c(%rbp), %r11
leaq -0x580(%rbp), %r10
leaq -0x584(%rbp), %rax
movq %rax, -0x598(%rbp)
movq -0x5a8(%rbp), %rax
movq %rax, (%rsp)
movq -0x5a0(%rbp), %rax
movq %rax, 0x8(%rsp)
movq -0x598(%rbp), %rax
movq %r13, 0x10(%rsp)
movq %r12, 0x18(%rsp)
movq %r15, 0x20(%rsp)
movq %r14, 0x28(%rsp)
movq %rbx, 0x30(%rsp)
movq %r11, 0x38(%rsp)
movq %r10, 0x40(%rsp)
movq %rax, 0x48(%rsp)
movb $0x0, %al
callq 0x1150
movl %eax, %ecx
movl $0xe, %eax
cmpl %ecx, %eax
je 0x2c48
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x11b0
movq -0x40(%rbp), %rdi
leaq -0x160(%rbp), %rsi
callq 0x4850
movq -0x40(%rbp), %rdi
movl -0x564(%rbp), %esi
callq 0x48a0
movq -0x40(%rbp), %rdi
movl -0x568(%rbp), %eax
movswl %ax, %esi
callq 0x48e0
movq -0x40(%rbp), %rdi
movl -0x56c(%rbp), %esi
movl -0x570(%rbp), %edx
callq 0x4930
movq -0x40(%rbp), %rdi
movswl -0x586(%rbp), %esi
callq 0x4980
movq -0x40(%rbp), %rdi
movswl -0x58c(%rbp), %esi
callq 0x49d0
movq -0x40(%rbp), %rdi
movswl -0x588(%rbp), %esi
callq 0x4a20
movq -0x40(%rbp), %rdi
movswl -0x58a(%rbp), %esi
callq 0x4a70
movq -0x40(%rbp), %rdi
movl -0x574(%rbp), %esi
callq 0x4ac0
movq -0x40(%rbp), %rdi
movl -0x578(%rbp), %esi
callq 0x4b00
movq -0x40(%rbp), %rdi
movl -0x57c(%rbp), %esi
callq 0x4b40
movq -0x40(%rbp), %rdi
movl -0x580(%rbp), %esi
callq 0x4b80
movq -0x40(%rbp), %rdi
movl -0x584(%rbp), %esi
callq 0x4bc0
movl $0x0, -0x54(%rbp)
movq -0x48(%rbp), %rax
movslq -0x568(%rbp), %rcx
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
movslq -0x54(%rbp), %rcx
cmpq $0x0, (%rax,%rcx,8)
je 0x2d4a
jmp 0x2d3f
movl -0x54(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x54(%rbp)
jmp 0x2d20
movq -0x40(%rbp), %rdi
callq 0x4f00
movq %rax, %rdx
movq -0x48(%rbp), %rax
movslq -0x568(%rbp), %rcx
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
movslq -0x54(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
jmp 0x2b32
movq -0x40(%rbp), %rdi
callq 0x4810
movq -0x50(%rbp), %rdi
callq 0x1060
movq -0x48(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
addq $0x5d8, %rsp            # imm = 0x5D8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopw %cs:(%rax,%rax)