// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x2240, %rsp           # imm = 0x2240
movq %rdi, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
jne 0x322a
movq $0x0, -0x28(%rbp)
jmp 0x347a
movl $0x8, %edi
callq 0x1130
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x40(%rbp)
jne 0x324c
movq $0x0, -0x28(%rbp)
jmp 0x347a
movl $0xd0, %edi
callq 0x1130
movq %rax, %rcx
movq -0x40(%rbp), %rax
movq %rcx, (%rax)
movq -0x30(%rbp), %rdi
leaq 0x5dc7(%rip), %rsi      # 0x9032
callq 0x1190
movq %rax, -0x50(%rbp)
cmpq $0x0, -0x50(%rbp)
jne 0x329d
movq -0x40(%rbp), %rax
movq (%rax), %rdi
callq 0x1030
movq -0x40(%rbp), %rdi
callq 0x1030
movq $0x0, -0x28(%rbp)
jmp 0x347a
movb $0x0, %al
callq 0x5010
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
jne 0x32da
movq -0x50(%rbp), %rdi
callq 0x1060
movq -0x40(%rbp), %rax
movq (%rax), %rdi
callq 0x1030
movq -0x40(%rbp), %rdi
callq 0x1030
movq $0x0, -0x28(%rbp)
jmp 0x347a
movl $0x0, -0x44(%rbp)
xorl %eax, %eax
cmpl $0x1a, -0x44(%rbp)
movb %al, -0x2221(%rbp)
jge 0x3306
movq -0x50(%rbp), %rdi
callq 0x10f0
cmpl $0x0, %eax
setne %al
xorb $-0x1, %al
movb %al, -0x2221(%rbp)
movb -0x2221(%rbp), %al
testb $0x1, %al
jne 0x3315
jmp 0x3460
leaq -0x2220(%rbp), %rdi
movq -0x50(%rbp), %rdx
movl $0xffc, %esi            # imm = 0xFFC
callq 0x10d0
leaq -0x2220(%rbp), %rdi
leaq -0x470(%rbp), %rcx
leaq -0x1220(%rbp), %rax
leaq 0x5e06(%rip), %rsi      # 0x914c
leaq -0x54(%rbp), %rdx
leaq -0x6a(%rbp), %r8
leaq -0x6c(%rbp), %r9
leaq -0x6e(%rbp), %r12
leaq -0x58(%rbp), %r15
leaq -0x5c(%rbp), %r14
leaq -0x60(%rbp), %rbx
leaq -0x64(%rbp), %r11
leaq -0x68(%rbp), %r10
movq %r12, (%rsp)
movq %r15, 0x8(%rsp)
movq %r14, 0x10(%rsp)
movq %rbx, 0x18(%rsp)
movq %r11, 0x20(%rsp)
movq %r10, 0x28(%rsp)
movq %rax, 0x30(%rsp)
movb $0x0, %al
callq 0x1150
movl %eax, %ecx
movl $0xb, %eax
cmpl %ecx, %eax
je 0x33a8
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x11b0
movq -0x38(%rbp), %rdi
movl -0x54(%rbp), %esi
callq 0x50c0
movq -0x38(%rbp), %rdi
leaq -0x470(%rbp), %rsi
callq 0x5330
movq -0x38(%rbp), %rdi
movswl -0x6a(%rbp), %esi
callq 0x5100
movq -0x38(%rbp), %rdi
movswl -0x6c(%rbp), %esi
callq 0x5150
movq -0x38(%rbp), %rdi
movswl -0x6e(%rbp), %esi
callq 0x51a0
movq -0x38(%rbp), %rdi
movl -0x58(%rbp), %esi
callq 0x51f0
movq -0x38(%rbp), %rdi
movl -0x5c(%rbp), %esi
callq 0x5230
movq -0x38(%rbp), %rdi
movl -0x60(%rbp), %esi
callq 0x5270
movq -0x38(%rbp), %rdi
movl -0x64(%rbp), %esi
callq 0x52b0
movq -0x38(%rbp), %rdi
movl -0x68(%rbp), %esi
callq 0x52f0
movq -0x38(%rbp), %rdi
leaq -0x1220(%rbp), %rsi
callq 0x5380
movq -0x38(%rbp), %rdi
callq 0x55e0
movq %rax, %rdx
movq -0x40(%rbp), %rax
movq (%rax), %rax
movslq -0x44(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0x32e1
movq -0x38(%rbp), %rdi
callq 0x5090
movq -0x50(%rbp), %rdi
callq 0x1060
movq -0x40(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
addq $0x2240, %rsp           # imm = 0x2240
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop