// File: /workspace/github_c_makefile_star2_O3/rafa9811[P]theIndiependenceGame/theindiependencegame.c
// Function: intro
void _intro(){
    sc_rectangle *intro;
    FILE * in;
    char *dialog=NULL, *ini, line[INTRO_LINE],choice, buff[MAX], *intropath = "intro.txt";
    int len,j=0,linenumber,x,y;

    intro = win_new(0,0,INTROY,INTROX,BGCOLOR,CHARCOLOR); /*Creating the intro window, which occupies all the screen.*/
    in = (FILE*) fopen(intropath, "r"); /*Openning the intro txt file which contains every dialog from the intro.*/

	if(!in) exit(-1);
    if (!intro) exit(-1);

	while(!feof(in)){
	  win_cls(intro);
		fscanf(in,"%d\t%d\t%[^\n]s",&x,&y,buff);
		linenumber=y;
		if(dialog) free(dialog);
		len = strlen(buff);
		dialog = (char*) malloc(len+1);
		strcpy(dialog,buff);
    ini=dialog;
    j=0;
    while(j<len && linenumber<INTROY){
      dialog = ini + j;
      memcpy(line,dialog,INTRO_LINE);
      win_write_line_at(intro,linenumber,x,line);
      j+=INTRO_LINE;
      linenumber++;
    }
		dialog = ini;
		choice = fgetc(stdin);
		while(choice!='a' && choice!='A' && choice!='\n'){
		    choice = fgetc(stdin);
		}
		if(choice=='\n'){
		    break;
		}
	}

	fclose(in);
	in = (FILE*) fopen("startmenu.txt", "r");
	win_cls(intro);
    while(!feof(in)){
		fscanf(in,"%d\t%d\t%[^\n]s",&x,&y,buff);
		len = strlen(buff);
		if(dialog) free(dialog);
		dialog = (char*) malloc(len+1);
		strcpy(dialog,buff);
    ini=dialog;
    j=0;
    while(j<len && linenumber<INTROY){
      dialog = ini + j;
      memcpy(line,dialog,INTRO_LINE);
      win_write_line_at(intro,y,x,line);
      j+=INTRO_LINE;
      linenumber++;
    }
		
    }
		choice = fgetc(stdin);
		while(choice!='q' && choice!='Q' && choice!='\n'){
		    choice = fgetc(stdin);
		}
		if(choice=='q' || choice == 'Q'){
		    exit(0);
		}
    fclose(in);
    win_delete(intro);
		if(dialog) free(dialog);
	return;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2788, %rsp           # imm = 0x2788
xorl %edi, %edi
xorl %esi, %esi
movl $0x2e, %edx
movl $0x78, %ecx
movl $0x1, %r8d
xorl %r9d, %r9d
callq 0x3ec7
movq %rax, %rbx
leaq 0x4b5c(%rip), %rdi      # 0x6030
leaq 0x4b5f(%rip), %rsi      # 0x603a
callq 0x1190
testq %rax, %rax
je 0x17fe
testq %rbx, %rbx
je 0x17fe
movq %rax, %r12
movq %rax, %rdi
callq 0x10f0
testl %eax, %eax
je 0x1509
xorl %r14d, %r14d
jmp 0x1647
leaq 0x70(%rsp), %r13
xorl %r14d, %r14d
movq %r12, 0x10(%rsp)
movq %rbx, %rdi
callq 0x3f12
movq %r12, %rdi
leaq 0x4b14(%rip), %rsi      # 0x603c
leaq 0xc(%rsp), %rdx
leaq 0x8(%rsp), %rcx
movq %r13, %r8
xorl %eax, %eax
callq 0x1060
movl 0x8(%rsp), %ebp
testq %r14, %r14
je 0x154d
movq %r14, %rdi
callq 0x1030
movq %r13, %rdi
callq 0x1080
movq %rax, %r12
shlq $0x20, %rax
movabsq $0x100000000, %rcx      # imm = 0x100000000
leaq (%rax,%rcx), %rdi
sarq $0x20, %rdi
callq 0x1130
movq %rax, %r14
movq %rax, %rdi
movq %r13, %rsi
callq 0x1050
testl %r12d, %r12d
setg %al
cmpl $0x2e, %ebp
setl %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x15d5
xorl %r13d, %r13d
leaq (%r14,%r13), %rsi
movl $0x41, %edx
leaq 0x20(%rsp), %r15
movq %r15, %rdi
callq 0x1100
movl 0xc(%rsp), %edx
movq %rbx, %rdi
movl %ebp, %esi
movq %r15, %rcx
callq 0x4025
addq $0x41, %r13
leal 0x1(%rbp), %r15d
cmpl %r12d, %r13d
jge 0x15d8
cmpl $0x2d, %ebp
movl %r15d, %ebp
jl 0x1597
jmp 0x15d8
movl %ebp, %r15d
movq 0x8a01(%rip), %rbp      # 0x9fe0
movq (%rbp), %rdi
callq 0x10d0
movl %eax, %ecx
shll $0x18, %ecx
andl $0xdf, %eax
cmpl $0x41, %eax
sete %al
cmpl $0xa000000, %ecx        # imm = 0xA000000
sete %dl
orb %al, %dl
movq 0x10(%rsp), %r12
leaq 0x70(%rsp), %r13
jne 0x162f
movq (%rbp), %rdi
callq 0x10d0
movl %eax, %ecx
shll $0x18, %ecx
andl $0xdf, %eax
cmpl $0x41, %eax
je 0x162f
cmpl $0xa000000, %ecx        # imm = 0xA000000
jne 0x160f
cmpl $0xa000000, %ecx        # imm = 0xA000000
je 0x1647
movq %r12, %rdi
callq 0x10f0
testl %eax, %eax
je 0x1516
movq %r12, %rdi
callq 0x1070
leaq 0x49f3(%rip), %rdi      # 0x6049
leaq 0x49dd(%rip), %rsi      # 0x603a
callq 0x1190
movq %rax, %r12
movq %rbx, 0x10(%rsp)
movq %rbx, %rdi
callq 0x3f12
movq %r12, %rdi
callq 0x10f0
testl %eax, %eax
jne 0x1767
leaq 0x70(%rsp), %rbx
leaq 0x20(%rsp), %r13
movq %r12, 0x18(%rsp)
movq %r12, %rdi
leaq 0x49a1(%rip), %rsi      # 0x603c
leaq 0xc(%rsp), %rdx
leaq 0x8(%rsp), %rcx
movq %rbx, %r8
xorl %eax, %eax
callq 0x1060
movq %rbx, %rdi
callq 0x1080
movq %rax, %rbp
testq %r14, %r14
je 0x16c7
movq %r14, %rdi
callq 0x1030
movq %rbp, %rdi
shlq $0x20, %rdi
movabsq $0x100000000, %rax      # imm = 0x100000000
addq %rax, %rdi
sarq $0x20, %rdi
callq 0x1130
movq %rax, %r14
movq %rax, %rdi
movq %rbx, %rsi
callq 0x1050
testl %ebp, %ebp
jle 0x1747
cmpl $0x2d, %r15d
jg 0x1747
addq $-0x41, %r14
movl $0x41, %r12d
addq $0x41, %r14
movl $0x41, %edx
movq %r13, %rdi
movq %r14, %rsi
callq 0x1100
movl 0x8(%rsp), %esi
movl 0xc(%rsp), %edx
movq 0x10(%rsp), %rdi
movq %r13, %rcx
callq 0x4025
leal 0x1(%r15), %ebx
cmpl %ebp, %r12d
jge 0x174a
addl $0x41, %r12d
cmpl $0x2d, %r15d
movl %ebx, %r15d
jl 0x1706
jmp 0x174a
movl %r15d, %ebx
movq 0x18(%rsp), %r12
movq %r12, %rdi
callq 0x10f0
movl %ebx, %r15d
testl %eax, %eax
leaq 0x70(%rsp), %rbx
je 0x1691
movq 0x8872(%rip), %r15      # 0x9fe0
movq (%r15), %rdi
callq 0x10d0
movl %eax, %ecx
shll $0x18, %ecx
movl %eax, %edx
andl $0xdf, %edx
cmpl $0x51, %edx
sete %dl
cmpl $0xa000000, %ecx        # imm = 0xA000000
sete %sil
orb %dl, %sil
movq 0x10(%rsp), %rbx
jne 0x17bf
movq (%r15), %rdi
callq 0x10d0
movl %eax, %ecx
shll $0x18, %ecx
movl %eax, %edx
andl $0xdf, %edx
cmpl $0x51, %edx
je 0x17bf
cmpl $0xa000000, %ecx        # imm = 0xA000000
jne 0x179d
cmpl $0x71000000, %ecx       # imm = 0x71000000
je 0x1808
andl $0x7b, %eax
cmpl $0x51, %eax
je 0x1808
movq %r12, %rdi
callq 0x1070
movq %rbx, %rdi
callq 0x3fbd
testq %r14, %r14
je 0x17ec
movq %r14, %rdi
callq 0x1030
addq $0x2788, %rsp           # imm = 0x2788
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x11b0
xorl %edi, %edi
callq 0x11b0