// File: /workspace/github_c_makefile_star2_O1/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 $0x288, %rsp            # imm = 0x288
testq %rdi, %rdi
je 0x4575
movq %rdi, %r14
movl $0x460, %edi            # imm = 0x460
callq 0x1130
testq %rax, %rax
je 0x4575
movq %rax, %rbx
leaq 0x1cb4(%rip), %rsi      # 0x603a
movq %r14, %rdi
callq 0x1190
testq %rax, %rax
je 0x456d
movq %rax, %r14
movq %rax, %rdi
callq 0x10f0
testl %eax, %eax
jne 0x44aa
leaq 0x1e97(%rip), %r15      # 0x6248
movq %rsp, %r12
leaq 0x80(%rsp), %r13
movabsq $0x737463656a624f, %rbp # imm = 0x737463656A624F
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
movq %r13, %rcx
xorl %eax, %eax
callq 0x1060
cmpq %rbp, (%rsp)
jne 0x43f0
movq %r13, %rdi
callq 0x2424
movq %rax, 0x18(%rbx)
jmp 0x449a
movq (%rsp), %rax
movabsq $0x726f746e65766e49, %rcx # imm = 0x726F746E65766E49
xorq %rcx, %rax
movzwl 0x8(%rsp), %ecx
xorq $0x79, %rcx
orq %rax, %rcx
je 0x4439
movl (%rsp), %eax
movl $0x706f6853, %ecx       # imm = 0x706F6853
xorl %ecx, %eax
movzbl 0x4(%rsp), %ecx
orl %eax, %ecx
je 0x4447
cmpl $0x70614d, (%rsp)       # imm = 0x70614D
jne 0x4455
movq %r13, %rdi
callq 0x28b0
movq %rax, 0x10(%rbx)
jmp 0x449a
movq %r13, %rdi
callq 0x20bd
movq %rax, 0x20(%rbx)
jmp 0x449a
movq %r13, %rdi
callq 0x20bd
movq %rax, 0x28(%rbx)
jmp 0x449a
movabsq $0x73676f6c616944, %rax # imm = 0x73676F6C616944
cmpq %rax, (%rsp)
jne 0x4473
movq %r13, %rdi
callq 0x1f77
movq %rax, 0x30(%rbx)
jmp 0x449a
movq (%rsp), %rax
movabsq $0x73676e697465654d, %rcx # imm = 0x73676E697465654D
xorq %rcx, %rax
movzbl 0x8(%rsp), %ecx
orq %rax, %rcx
jne 0x449a
movq %r13, %rdi
callq 0x2b43
movq %rax, 0x38(%rbx)
movq %r14, %rdi
callq 0x10f0
testl %eax, %eax
je 0x43c6
xorl %eax, %eax
callq 0x3df4
movq %rax, %r15
movq %rax, (%rbx)
xorl %eax, %eax
callq 0x41f8
movq %rax, 0x8(%rbx)
movq 0x18(%rbx), %r12
testq %r12, %r12
je 0x458c
cmpq $0x0, 0x20(%rbx)
je 0x458c
cmpq $0x0, 0x28(%rbx)
je 0x458c
movq 0x10(%rbx), %r13
testq %r13, %r13
je 0x458c
cmpq $0x0, 0x30(%rbx)
je 0x458c
cmpq $0x0, 0x38(%rbx)
je 0x458c
testq %r15, %r15
je 0x458c
testq %rax, %rax
je 0x458c
movq %rbx, %rdi
addq $0x40, %rdi
xorl %eax, %eax
movq %rax, 0x446(%rbx)
movq %rax, 0x440(%rbx)
leaq 0x1d37(%rip), %rsi      # 0x6267
movl $0x91, %edx
callq 0x1100
movabsq $0x1400000046, %rax     # imm = 0x1400000046
movq %rax, 0x450(%rbx)
movl $0x1, 0x458(%rbx)
movq %r12, %rdi
movq %r13, %rsi
movq %r15, %rdx
callq 0x2ed8
movq %r14, %rdi
callq 0x1070
jmp 0x4577
movq %rbx, %rdi
callq 0x1030
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x288, %rsp            # imm = 0x288
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %edi, %edi
callq 0x11b0