// File: /workspace/github_c_makefile_star2_O3/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 0x4343
movq %rdi, %r14
movl $0x460, %edi            # imm = 0x460
callq 0x1130
testq %rax, %rax
je 0x4343
movq %rax, %rbx
leaq 0x1d20(%rip), %rsi      # 0x603a
movq %r14, %rdi
callq 0x1190
testq %rax, %rax
je 0x433b
movq %rax, %r14
movq %rax, %rdi
callq 0x10f0
testl %eax, %eax
je 0x434a
jmp 0x4493
movq %rbx, %rdi
callq 0x1030
xorl %ebx, %ebx
jmp 0x454b
leaq 0x30(%rsp), %rbp
leaq 0xb0(%rsp), %r15
movabsq $0x737463656a624f, %r13 # imm = 0x737463656A624F
movq %r14, %rdi
leaq 0x1edd(%rip), %rsi      # 0x6248
movq %rbp, %rdx
movq %r15, %rcx
xorl %eax, %eax
callq 0x1060
movq 0x30(%rsp), %rax
cmpq %r13, %rax
jne 0x4396
movq %r15, %rdi
callq 0x2444
movq %rax, %r12
movq %rax, 0x18(%rbx)
jmp 0x4459
movq 0x30(%rsp), %rcx
movabsq $0x726f746e65766e49, %rdx # imm = 0x726F746E65766E49
xorq %rdx, %rcx
movzwl 0x38(%rsp), %edx
xorq $0x79, %rdx
orq %rcx, %rdx
je 0x43e4
movl 0x30(%rsp), %ecx
movl $0x706f6853, %edx       # imm = 0x706F6853
xorl %edx, %ecx
movzbl 0x34(%rsp), %edx
orl %ecx, %edx
je 0x43f7
cmpl $0x70614d, %eax         # imm = 0x70614D
jne 0x440a
movq %r15, %rdi
callq 0x28bd
movq %rax, 0x18(%rsp)
movq %rax, 0x10(%rbx)
jmp 0x4459
movq %r15, %rdi
callq 0x20cc
movq %rax, 0x10(%rsp)
movq %rax, 0x20(%rbx)
jmp 0x4459
movq %r15, %rdi
callq 0x20cc
movq %rax, 0x8(%rsp)
movq %rax, 0x28(%rbx)
jmp 0x4459
movabsq $0x73676f6c616944, %rcx # imm = 0x73676F6C616944
cmpq %rcx, %rax
jne 0x442c
movq %r15, %rdi
callq 0x1f87
movq %rax, 0x28(%rsp)
movq %rax, 0x30(%rbx)
jmp 0x4459
movq 0x30(%rsp), %rax
movabsq $0x73676e697465654d, %rcx # imm = 0x73676E697465654D
xorq %rcx, %rax
movzbl 0x38(%rsp), %ecx
orq %rax, %rcx
jne 0x4459
movq %r15, %rdi
callq 0x2b50
movq %rax, 0x20(%rsp)
movq %rax, 0x38(%rbx)
movq %r14, %rdi
callq 0x10f0
testl %eax, %eax
je 0x4361
cmpq $0x0, 0x10(%rsp)
sete %r13b
cmpq $0x0, 0x8(%rsp)
sete %bpl
cmpq $0x0, 0x28(%rsp)
sete 0x10(%rsp)
cmpq $0x0, 0x20(%rsp)
sete 0x8(%rsp)
xorl %eax, %eax
callq 0x3da4
movq %rax, %r15
movq %rax, (%rbx)
xorl %eax, %eax
callq 0x41b0
movq %rax, 0x8(%rbx)
testq %r12, %r12
je 0x4560
testb $0x1, %r13b
jne 0x4560
testb $0x1, %bpl
jne 0x4560
cmpq $0x0, 0x18(%rsp)
je 0x4560
testb $0x1, 0x10(%rsp)
jne 0x4560
testb $0x1, 0x8(%rsp)
jne 0x4560
testq %r15, %r15
je 0x4560
testq %rax, %rax
je 0x4560
movq %rbx, %rdi
addq $0x40, %rdi
xorl %eax, %eax
movq %rax, 0x446(%rbx)
movq %rax, 0x440(%rbx)
leaq 0x1d59(%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 0x18(%rsp), %rsi
movq %r15, %rdx
callq 0x2ec1
movq %r14, %rdi
callq 0x1070
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 0x11b0