// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x27b0, %rsp           # imm = 0x27B0
movq $0x0, -0x18(%rbp)
leaq 0x7b4e(%rip), %rax      # 0x9028
movq %rax, -0x2798(%rbp)
movl $0x0, -0x27a0(%rbp)
xorl %r9d, %r9d
movl $0x2e, %edx
movl $0x78, %ecx
movl $0x1, %r8d
movl %r9d, %edi
movl %r9d, %esi
callq 0x5b20
movq %rax, -0x8(%rbp)
movq -0x2798(%rbp), %rdi
leaq 0x7b17(%rip), %rsi      # 0x9032
callq 0x1190
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x1535
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x11b0
cmpq $0x0, -0x8(%rbp)
jne 0x1546
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x11b0
jmp 0x1548
movq -0x10(%rbp), %rdi
callq 0x10f0
cmpl $0x0, %eax
setne %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x1562
jmp 0x1705
movq -0x8(%rbp), %rdi
callq 0x5b90
movq -0x10(%rbp), %rdi
leaq -0x2790(%rbp), %r8
leaq 0x7ab7(%rip), %rsi      # 0x9034
leaq -0x27a8(%rbp), %rdx
leaq -0x27ac(%rbp), %rcx
movb $0x0, %al
callq 0x1050
movl -0x27ac(%rbp), %eax
movl %eax, -0x27a4(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x15ae
movq -0x18(%rbp), %rdi
callq 0x1030
leaq -0x2790(%rbp), %rdi
callq 0x1070
movl %eax, -0x279c(%rbp)
movl -0x279c(%rbp), %eax
addl $0x1, %eax
movslq %eax, %rdi
callq 0x1130
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
leaq -0x2790(%rbp), %rsi
callq 0x1040
movq -0x18(%rbp), %rax
movq %rax, -0x20(%rbp)
movl $0x0, -0x27a0(%rbp)
movl -0x27a0(%rbp), %ecx
xorl %eax, %eax
cmpl -0x279c(%rbp), %ecx
movb %al, -0x27ad(%rbp)
jge 0x161d
cmpl $0x2e, -0x27a4(%rbp)
setl %al
movb %al, -0x27ad(%rbp)
movb -0x27ad(%rbp), %al
testb $0x1, %al
jne 0x1629
jmp 0x1689
movq -0x20(%rbp), %rax
movslq -0x27a0(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x18(%rbp)
leaq -0x70(%rbp), %rdi
movq -0x18(%rbp), %rsi
movl $0x41, %edx
callq 0x1100
movq -0x8(%rbp), %rdi
movl -0x27a4(%rbp), %esi
movl -0x27a8(%rbp), %edx
leaq -0x70(%rbp), %rcx
callq 0x5dd0
movl -0x27a0(%rbp), %eax
addl $0x41, %eax
movl %eax, -0x27a0(%rbp)
movl -0x27a4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x27a4(%rbp)
jmp 0x15f7
movq -0x20(%rbp), %rax
movq %rax, -0x18(%rbp)
movq 0xb948(%rip), %rax      # 0xcfe0
movq (%rax), %rdi
callq 0x10c0
movb %al, -0x71(%rbp)
movsbl -0x71(%rbp), %ecx
xorl %eax, %eax
cmpl $0x61, %ecx
movb %al, -0x27ae(%rbp)
je 0x16d5
movsbl -0x71(%rbp), %ecx
xorl %eax, %eax
cmpl $0x41, %ecx
movb %al, -0x27ae(%rbp)
je 0x16d5
movsbl -0x71(%rbp), %eax
cmpl $0xa, %eax
setne %al
movb %al, -0x27ae(%rbp)
movb -0x27ae(%rbp), %al
testb $0x1, %al
jne 0x16e1
jmp 0x16f5
movq 0xb8f8(%rip), %rax      # 0xcfe0
movq (%rax), %rdi
callq 0x10c0
movb %al, -0x71(%rbp)
jmp 0x16a3
movsbl -0x71(%rbp), %eax
cmpl $0xa, %eax
jne 0x1700
jmp 0x1705
jmp 0x1548
movq -0x10(%rbp), %rdi
callq 0x1060
leaq 0x792c(%rip), %rdi      # 0x9041
leaq 0x7916(%rip), %rsi      # 0x9032
callq 0x1190
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rdi
callq 0x5b90
movq -0x10(%rbp), %rdi
callq 0x10f0
cmpl $0x0, %eax
setne %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x1748
jmp 0x185f
movq -0x10(%rbp), %rdi
leaq -0x2790(%rbp), %r8
leaq 0x78da(%rip), %rsi      # 0x9034
leaq -0x27a8(%rbp), %rdx
leaq -0x27ac(%rbp), %rcx
movb $0x0, %al
callq 0x1050
leaq -0x2790(%rbp), %rdi
callq 0x1070
movl %eax, -0x279c(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x1791
movq -0x18(%rbp), %rdi
callq 0x1030
movl -0x279c(%rbp), %eax
addl $0x1, %eax
movslq %eax, %rdi
callq 0x1130
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
leaq -0x2790(%rbp), %rsi
callq 0x1040
movq -0x18(%rbp), %rax
movq %rax, -0x20(%rbp)
movl $0x0, -0x27a0(%rbp)
movl -0x27a0(%rbp), %ecx
xorl %eax, %eax
cmpl -0x279c(%rbp), %ecx
movb %al, -0x27af(%rbp)
jge 0x17ee
cmpl $0x2e, -0x27a4(%rbp)
setl %al
movb %al, -0x27af(%rbp)
movb -0x27af(%rbp), %al
testb $0x1, %al
jne 0x17fa
jmp 0x185a
movq -0x20(%rbp), %rax
movslq -0x27a0(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x18(%rbp)
leaq -0x70(%rbp), %rdi
movq -0x18(%rbp), %rsi
movl $0x41, %edx
callq 0x1100
movq -0x8(%rbp), %rdi
movl -0x27ac(%rbp), %esi
movl -0x27a8(%rbp), %edx
leaq -0x70(%rbp), %rcx
callq 0x5dd0
movl -0x27a0(%rbp), %eax
addl $0x41, %eax
movl %eax, -0x27a0(%rbp)
movl -0x27a4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x27a4(%rbp)
jmp 0x17c8
jmp 0x172e
movq 0xb77a(%rip), %rax      # 0xcfe0
movq (%rax), %rdi
callq 0x10c0
movb %al, -0x71(%rbp)
movsbl -0x71(%rbp), %ecx
xorl %eax, %eax
cmpl $0x71, %ecx
movb %al, -0x27b0(%rbp)
je 0x18a3
movsbl -0x71(%rbp), %ecx
xorl %eax, %eax
cmpl $0x51, %ecx
movb %al, -0x27b0(%rbp)
je 0x18a3
movsbl -0x71(%rbp), %eax
cmpl $0xa, %eax
setne %al
movb %al, -0x27b0(%rbp)
movb -0x27b0(%rbp), %al
testb $0x1, %al
jne 0x18af
jmp 0x18c3
movq 0xb72a(%rip), %rax      # 0xcfe0
movq (%rax), %rdi
callq 0x10c0
movb %al, -0x71(%rbp)
jmp 0x1871
movsbl -0x71(%rbp), %eax
cmpl $0x71, %eax
je 0x18d5
movsbl -0x71(%rbp), %eax
cmpl $0x51, %eax
jne 0x18dc
xorl %edi, %edi
callq 0x11b0
movq -0x10(%rbp), %rdi
callq 0x1060
movq -0x8(%rbp), %rdi
callq 0x5ca0
cmpq $0x0, -0x18(%rbp)
je 0x18fe
movq -0x18(%rbp), %rdi
callq 0x1030
addq $0x27b0, %rsp           # imm = 0x27B0
popq %rbp
retq
nopw (%rax,%rax)