// File: /workspace/github_c_makefile_star2_O2/rafa9811[P]theIndiependenceGame/background.c
// Function: map_load
Map * map_load (char *filename){
    Place* paux;
    Map* map;
     int i;
	FILE *in;

	int id,stars,up,down,left,right;
	short is_locked,leavebox,leftbox;
	char desc[1024],draw[3500],buff[4092];

	if(!filename) return NULL;

	map=(Map*)malloc(sizeof(Map));
	if(!map) return NULL;

	map->map=(Place**)malloc(sizeof(Place*)*MAX_PLC);

	in = (FILE*) fopen(filename, "r");
	if (!in) {
		free(map->map);
		free(map);
		return NULL;
	}
    paux=place_ini();
    if(!paux){
		fclose(in);
		free(map->map);
		free(map);
		return NULL;
	}

  for(i=0;i<MAX_PLC && !feof(in);i++){
		fgets(buff,4092,in);
    if(11!=sscanf(buff,"%d\t%[^\t]%hd\t%hd\t%hd\t%d\t%d\t%d\t%d\t%d\t%[^\n]",&id,desc,&is_locked,&leavebox,&leftbox,&stars,&up,&down,&left,&right,draw)) exit(-1);
    place_setId(paux,id);
    place_setDesc(paux,desc);
    place_setLock(paux,is_locked);
    place_setLeaveBox(paux,leavebox);
    place_setLeftBox(paux,leftbox);
    place_setStars(paux,stars);
    place_setUp(paux,up);
    place_setDown(paux,down);
    place_setLeft(paux,left);
    place_setRight(paux,right);
    place_setDraw(paux,draw);
    map->map[i]=place_copy(paux);
  }
	place_destroy(paux);
	fclose(in);
	return map;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x21e8, %rsp           # imm = 0x21E8
testq %rdi, %rdi
je 0x2920
movq %rdi, %r15
pushq $0x8
popq %rdi
callq 0x1130
testq %rax, %rax
je 0x2920
movq %rax, %rbx
movl $0xd0, %edi
callq 0x1130
movq %rax, %r14
movq %rax, (%rbx)
leaq 0x38cd(%rip), %rsi      # 0x603a
movq %r15, %rdi
callq 0x11a0
testq %rax, %rax
je 0x2910
movq %rax, %rbp
xorl %eax, %eax
callq 0x3868
testq %rax, %rax
je 0x2908
movq %rax, %r12
movq %rbx, 0x20(%rsp)
leaq 0x430(%rsp), %rbx
leaq 0x30(%rsp), %r13
xorl %eax, %eax
movq %rax, 0x28(%rsp)
cmpq $0x1a, %rax
je 0x28f1
movq %rbp, %rdi
callq 0x10f0
testl %eax, %eax
jne 0x28f1
movq %rbp, %rdx
movq %r14, %r15
movq %r13, %r14
movq %rbx, %r13
leaq 0x11e0(%rsp), %rbx
movq %rbx, %rdi
movl $0xffc, %esi            # imm = 0xFFC
callq 0x10e0
subq $0x8, %rsp
movq %rbx, %rdi
movq %r13, %rbx
movq %r14, %r13
leaq 0x3958(%rip), %rsi      # 0x6154
leaq 0x24(%rsp), %rdx
movq %r14, %rcx
leaq 0xe(%rsp), %r8
leaq 0xc(%rsp), %r9
xorl %eax, %eax
pushq %rbx
leaq 0x18(%rsp), %r10
pushq %r10
leaq 0x24(%rsp), %r10
pushq %r10
leaq 0x30(%rsp), %r10
pushq %r10
leaq 0x3c(%rsp), %r10
pushq %r10
leaq 0x48(%rsp), %r10
pushq %r10
leaq 0x3a(%rsp), %r10
pushq %r10
callq 0x1150
addq $0x40, %rsp
cmpl $0xb, %eax
jne 0x2934
movl 0x1c(%rsp), %esi
movq %r12, %rdi
callq 0x3891
movq %r12, %rdi
movq %r13, %rsi
callq 0x397e
movswl 0x6(%rsp), %esi
movq %r12, %rdi
callq 0x38a9
movswl 0x4(%rsp), %esi
movq %r12, %rdi
callq 0x38c5
movswl 0x2(%rsp), %esi
movq %r12, %rdi
callq 0x38e1
movl 0x18(%rsp), %esi
movq %r12, %rdi
callq 0x38fd
movl 0x14(%rsp), %esi
movq %r12, %rdi
callq 0x3916
movl 0x10(%rsp), %esi
movq %r12, %rdi
callq 0x3930
movl 0xc(%rsp), %esi
movq %r12, %rdi
callq 0x394a
movl 0x8(%rsp), %esi
movq %r12, %rdi
callq 0x3964
movq %r12, %rdi
movq %rbx, %rsi
callq 0x39a4
movq %r12, %rdi
callq 0x3a62
movq %r15, %r14
movq 0x28(%rsp), %rcx
movq %rax, (%r15,%rcx,8)
movq %rcx, %rax
incq %rax
jmp 0x27a8
movq %r12, %rdi
callq 0x388c
movq %rbp, %rdi
callq 0x1070
movq 0x20(%rsp), %rax
jmp 0x2922
movq %rbp, %rdi
callq 0x1070
movq %r14, %rdi
callq 0x1030
movq %rbx, %rdi
callq 0x1030
xorl %eax, %eax
addq $0x21e8, %rsp           # imm = 0x21E8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $-0x1
popq %rdi
callq 0x11c0