// File: /workspace/github_c_makefile_star2_O0/oridb[P]mc/parse/tok.c
// Function: tokinit
void
tokinit(char *file)
{
	int fd;
	int n;
	int nread;

	fd = open(file, O_RDONLY);
	if (fd == -1) {
		fprintf(stderr, "Unable to open file %s\n", file);
		exit(1);
	}

	nread = 0;
	fbuf = malloc(4096);
	while (1) {
		n = read(fd, fbuf + nread, 4096);
		if (n < 0)
			fatal(0, 0, "Error reading file %s", file);
		if (n == 0)
			break;
		if (!fbuf)
			die("Out of memory reading %s", file);
		nread += n;
		fbuf = xrealloc(fbuf, nread + 4096);
	}

	fbufsz = nread;
	curloc.line = 1;
	curloc.file = 0;
	close(fd);
	if(fbufsz > 2 && fbuf[0] == '#' && fbuf[1] == '!') {
		for (fidx = 0; fidx < fbufsz; fidx++)  {
			if(fbuf[fidx] == '\n') {
				curloc.line++;
				fidx++;
				break;
			}
		}
	}
	filename = strdup(file);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
xorl %esi, %esi
movb $0x0, %al
callq 0x62c0
movl %eax, -0xc(%rbp)
cmpl $-0x1, -0xc(%rbp)
jne 0x34dd8
movq 0x2a237(%rip), %rax     # 0x5eff0
movq (%rax), %rdi
movq -0x8(%rbp), %rdx
leaq 0x1eced(%rip), %rsi     # 0x53ab4
movb $0x0, %al
callq 0x6230
movl $0x1, %edi
callq 0x6310
movl $0x0, -0x14(%rbp)
movl $0x1000, %edi           # imm = 0x1000
callq 0x6280
movq %rax, 0x48ed0(%rip)     # 0x7dcc0
movl -0xc(%rbp), %edi
movq 0x48ec6(%rip), %rsi     # 0x7dcc0
movslq -0x14(%rbp), %rax
addq %rax, %rsi
movl $0x1000, %edx           # imm = 0x1000
callq 0x61e0
movl %eax, -0x10(%rbp)
cmpl $0x0, -0x10(%rbp)
jge 0x34e2d
movq -0x8(%rbp), %rcx
xorl %eax, %eax
movl %eax, %esi
leaq 0x1eca9(%rip), %rdx     # 0x53acc
movq %rsi, %rdi
movb $0x0, %al
callq 0x1dfe0
cmpl $0x0, -0x10(%rbp)
jne 0x34e35
jmp 0x34e7d
cmpq $0x0, 0x48e83(%rip)     # 0x7dcc0
jne 0x34e51
movq -0x8(%rbp), %rsi
leaq 0x1ec98(%rip), %rdi     # 0x53ae2
movb $0x0, %al
callq 0x1df20
movl -0x10(%rbp), %eax
addl -0x14(%rbp), %eax
movl %eax, -0x14(%rbp)
movq 0x48e5f(%rip), %rdi     # 0x7dcc0
movl -0x14(%rbp), %eax
addl $0x1000, %eax           # imm = 0x1000
movslq %eax, %rsi
callq 0x48240
movq %rax, 0x48e48(%rip)     # 0x7dcc0
jmp 0x34df0
movl -0x14(%rbp), %eax
movl %eax, 0x48e42(%rip)     # 0x7dcc8
movl $0x1, 0x48e3c(%rip)     # 0x7dccc
movl $0x0, 0x48e36(%rip)     # 0x7dcd0
movl -0xc(%rbp), %edi
callq 0x61c0
cmpl $0x2, 0x48e1f(%rip)     # 0x7dcc8
jle 0x34f32
movq 0x48e0a(%rip), %rax     # 0x7dcc0
movsbl (%rax), %eax
cmpl $0x23, %eax
jne 0x34f32
movq 0x48dfb(%rip), %rax     # 0x7dcc0
movsbl 0x1(%rax), %eax
cmpl $0x21, %eax
jne 0x34f32
movl $0x0, 0x48dfc(%rip)     # 0x7dcd4
movl 0x48df6(%rip), %eax     # 0x7dcd4
cmpl 0x48de4(%rip), %eax     # 0x7dcc8
jge 0x34f30
movq 0x48dd3(%rip), %rax     # 0x7dcc0
movslq 0x48de0(%rip), %rcx     # 0x7dcd4
movsbl (%rax,%rcx), %eax
cmpl $0xa, %eax
jne 0x34f1d
movl 0x48dc9(%rip), %eax     # 0x7dccc
addl $0x1, %eax
movl %eax, 0x48dc0(%rip)     # 0x7dccc
movl 0x48dc2(%rip), %eax     # 0x7dcd4
addl $0x1, %eax
movl %eax, 0x48db9(%rip)     # 0x7dcd4
jmp 0x34f30
jmp 0x34f1f
movl 0x48daf(%rip), %eax     # 0x7dcd4
addl $0x1, %eax
movl %eax, 0x48da6(%rip)     # 0x7dcd4
jmp 0x34ed8
jmp 0x34f32
movq -0x8(%rbp), %rdi
callq 0x6330
movq %rax, 0x48d96(%rip)     # 0x7dcd8
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)