// File: /workspace/github_c_makefile_star2_O1/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 0x2aa5
movq %rdi, %r15
movl $0x8, %edi
callq 0x1130
testq %rax, %rax
je 0x2aa5
movq %rax, %rbx
movl $0xd0, %edi
callq 0x1130
movq %rax, %r14
movq %rax, (%rbx)
leaq 0x3740(%rip), %rsi      # 0x603a
movq %r15, %rdi
callq 0x1190
testq %rax, %rax
je 0x2a95
movq %rax, %r15
xorl %eax, %eax
callq 0x3ac4
testq %rax, %rax
je 0x2a8d
movq %rax, %r12
movq %rbx, 0x20(%rsp)
leaq 0x430(%rsp), %rbp
leaq 0x30(%rsp), %r13
xorl %ebx, %ebx
movq %r15, 0x28(%rsp)
movq %r15, %rdi
callq 0x10f0
testl %eax, %eax
jne 0x2a76
movq %r15, %rdx
movq %r14, %r15
movq %r13, %r14
movq %rbp, %r13
leaq 0x11e0(%rsp), %rbp
movq %rbp, %rdi
movl $0xffc, %esi            # imm = 0xFFC
callq 0x10e0
subq $0x8, %rsp
movq %rbp, %rdi
movq %r13, %rbp
movq %r14, %r13
leaq 0x37d5(%rip), %rsi      # 0x6154
leaq 0x24(%rsp), %rdx
movq %r14, %rcx
leaq 0xe(%rsp), %r8
leaq 0xc(%rsp), %r9
xorl %eax, %eax
pushq %rbp
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 0x2ab9
movl 0x1c(%rsp), %esi
movq %r12, %rdi
callq 0x3afa
movq %r12, %rdi
movq %r13, %rsi
callq 0x3be7
movswl 0x6(%rsp), %esi
movq %r12, %rdi
callq 0x3b12
movswl 0x4(%rsp), %esi
movq %r12, %rdi
callq 0x3b2e
movswl 0x2(%rsp), %esi
movq %r12, %rdi
callq 0x3b4a
movl 0x18(%rsp), %esi
movq %r12, %rdi
callq 0x3b66
movl 0x14(%rsp), %esi
movq %r12, %rdi
callq 0x3b7f
movl 0x10(%rsp), %esi
movq %r12, %rdi
callq 0x3b99
movl 0xc(%rsp), %esi
movq %r12, %rdi
callq 0x3bb3
movl 0x8(%rsp), %esi
movq %r12, %rdi
callq 0x3bcd
movq %r12, %rdi
movq %rbp, %rsi
callq 0x3c0d
movq %r12, %rdi
callq 0x3cd7
movq %r15, %r14
movq %rax, (%r15,%rbx,8)
incq %rbx
cmpq $0x1a, %rbx
movq 0x28(%rsp), %r15
jne 0x293a
movq %r12, %rdi
callq 0x3af0
movq %r15, %rdi
callq 0x1070
movq 0x20(%rsp), %rax
jmp 0x2aa7
movq %r15, %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
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x11b0