// File: /workspace/github_c_makefile_star2_O2/rafa9811[P]theIndiependenceGame/interact.c
// Function: interact_load
Interact *interact_load(char*filename){
  Interact *interact;
	char path[512],name[128];
	FILE *in;

	if(!filename) return NULL;

	interact=(Interact*)malloc(sizeof(Interact));
	if(!interact) return NULL;

	in = (FILE*) fopen(filename, "r");
	if(!in){
		free(interact);
		return NULL;
	}

	while(!feof(in)){
		fscanf(in,"%s\t%s\n",name,path);
        if(strcmp(name,"Objects")==0){
            IN(objects)=mobjects_load(path);
        }
        else if(strcmp(name,"Inventory")==0){
            IN(inventory)=inventory_load(path);
        }
        else if(strcmp(name,"Shop")==0){
            IN(shop)=inventory_load(path);
        }
        else if(strcmp(name,"Map")==0){
            IN(map)=map_load(path);
        }
        else if(strcmp(name,"Dialogs")==0){
            IN(dialogs)=dialogs_load(path);
        }
        else if(strcmp(name,"Meetings")==0){
            IN(meeting)=meeting_load(path);
        }
	}

	IN(player)=player_ini();
	IN(stat)=stat_ini();

	if(!IN(objects) || !IN(inventory) || !IN(shop) || !IN(map) || !IN(dialogs) || !IN(meeting) || !IN(player) || !IN(stat)) exit(0);
    IN(boxes)=0;
    IN(printers)=0;
    IN(meetings)=0;
    IN(danger)=0;
    strcpy(IN(dialog),"Welcome to Barçalona Président! Press I to open the inventory, Q for quitting the game, or A for interacting. Good luck on not being arrested!");
    IN(px)=INIX;
    IN(py)=INIY;
    IN(correct)=1;
    bg_updateRoom(IN(objects),IN(map),IN(player));
	fclose(in);
	return interact;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2b8, %rsp            # imm = 0x2B8
testq %rdi, %rdi
je 0x424e
movq %rdi, %r14
movl $0x460, %edi            # imm = 0x460
callq 0x1130
testq %rax, %rax
je 0x424e
movq %rax, %rbx
leaq 0x2000(%rip), %rsi      # 0x603a
movq %r14, %rdi
callq 0x11a0
testq %rax, %rax
je 0x4246
movq %rax, %r14
leaq 0x30(%rsp), %r13
leaq 0xb0(%rsp), %r15
movabsq $0x737463656a624f, %r12 # imm = 0x737463656A624F
movq %r14, %rdi
callq 0x10f0
testl %eax, %eax
jne 0x417e
movq %r14, %rdi
leaq 0x21c9(%rip), %rsi      # 0x6248
movq %r13, %rdx
movq %r15, %rcx
xorl %eax, %eax
callq 0x1060
movq 0x30(%rsp), %rbp
cmpq %r12, %rbp
je 0x4110
movq %r13, %rdi
leaq 0x21af(%rip), %rsi      # 0x624f
pushq $0xa
popq %rdx
callq 0x1160
testl %eax, %eax
je 0x4126
movq %r13, %rdi
leaq 0x21a3(%rip), %rsi      # 0x6259
pushq $0x5
popq %rdx
callq 0x1160
testl %eax, %eax
je 0x413c
cmpl $0x70614d, %ebp         # imm = 0x70614D
je 0x4152
movabsq $0x73676f6c616944, %rax # imm = 0x73676F6C616944
cmpq %rax, %rbp
je 0x4168
movq %r13, %rdi
leaq 0x2173(%rip), %rsi      # 0x625e
pushq $0x9
popq %rdx
callq 0x1160
testl %eax, %eax
jne 0x4065
movq %r15, %rdi
callq 0x29be
movq %rax, (%rsp)
movq %rax, 0x38(%rbx)
jmp 0x4065
movq %r15, %rdi
callq 0x22d2
movq %rax, 0x28(%rsp)
movq %rax, 0x18(%rbx)
jmp 0x4065
movq %r15, %rdi
callq 0x1f77
movq %rax, 0x20(%rsp)
movq %rax, 0x20(%rbx)
jmp 0x4065
movq %r15, %rdi
callq 0x1f77
movq %rax, 0x18(%rsp)
movq %rax, 0x28(%rbx)
jmp 0x4065
movq %r15, %rdi
callq 0x2725
movq %rax, 0x10(%rsp)
movq %rax, 0x10(%rbx)
jmp 0x4065
movq %r15, %rdi
callq 0x1e49
movq %rax, 0x8(%rsp)
movq %rax, 0x30(%rbx)
jmp 0x4065
xorl %eax, %eax
callq 0x3b34
movq %rax, %r15
movq %rax, (%rbx)
xorl %eax, %eax
callq 0x3ee8
movq %rax, 0x8(%rbx)
movq 0x28(%rsp), %r13
testq %r13, %r13
movq 0x10(%rsp), %r12
je 0x4265
cmpq $0x0, 0x20(%rsp)
je 0x4265
cmpq $0x0, 0x18(%rsp)
je 0x4265
testq %r12, %r12
je 0x4265
cmpq $0x0, 0x8(%rsp)
je 0x4265
cmpq $0x0, (%rsp)
je 0x4265
testq %r15, %r15
je 0x4265
testq %rax, %rax
je 0x4265
movq %rbx, %rdi
andq $0x0, 0x446(%rbx)
addq $0x40, %rdi
andq $0x0, 0x440(%rbx)
leaq 0x205e(%rip), %rsi      # 0x6267
movl $0x91, %edx
callq 0x1100
movabsq $0x1400000046, %rax     # imm = 0x1400000046
movq %rax, 0x450(%rbx)
movl $0x1, 0x458(%rbx)
movq %r13, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x2d06
movq %r14, %rdi
callq 0x1070
jmp 0x4250
movq %rbx, %rdi
callq 0x1030
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x2b8, %rsp            # imm = 0x2B8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %edi, %edi
callq 0x11c0