// File: /workspace/github_c_makefile_star2_O0/ccxvii[P]mujs/main.c
// Function: jsB_read
static void jsB_read(js_State *J)
{
	const char *filename = js_tostring(J, 1);
	FILE *f;
	char *s;
	int n, t;

	f = fopen(filename, "rb");
	if (!f) {
		js_error(J, "cannot open file '%s': %s", filename, strerror(errno));
	}

	if (fseek(f, 0, SEEK_END) < 0) {
		fclose(f);
		js_error(J, "cannot seek in file '%s': %s", filename, strerror(errno));
	}

	n = ftell(f);
	if (n < 0) {
		fclose(f);
		js_error(J, "cannot tell in file '%s': %s", filename, strerror(errno));
	}

	if (fseek(f, 0, SEEK_SET) < 0) {
		fclose(f);
		js_error(J, "cannot seek in file '%s': %s", filename, strerror(errno));
	}

	s = malloc(n + 1);
	if (!s) {
		fclose(f);
		js_error(J, "out of memory");
	}

	t = fread(s, 1, n, f);
	if (t != n) {
		free(s);
		fclose(f);
		js_error(J, "cannot read data from file '%s': %s", filename, strerror(errno));
	}
	s[n] = 0;

	js_pushstring(J, s);
	free(s);
	fclose(f);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x14b80
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rdi
leaq 0x2f32d(%rip), %rsi     # 0x33139
callq 0x3160
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x3e51
movq -0x8(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x30(%rbp)
callq 0x32b0
movl (%rax), %edi
callq 0x3230
movq -0x38(%rbp), %rdi
movq -0x30(%rbp), %rdx
movq %rax, %rcx
leaq 0x2f2f2(%rip), %rsi     # 0x3313c
movb $0x0, %al
callq 0xbb10
movq -0x18(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
movl $0x2, %edx
callq 0x30f0
cmpl $0x0, %eax
jge 0x3ea6
movq -0x18(%rbp), %rdi
callq 0x3310
movq -0x8(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x40(%rbp)
callq 0x32b0
movl (%rax), %edi
callq 0x3230
movq -0x48(%rbp), %rdi
movq -0x40(%rbp), %rdx
movq %rax, %rcx
leaq 0x2f2b7(%rip), %rsi     # 0x33156
movb $0x0, %al
callq 0xbb10
movq -0x18(%rbp), %rdi
callq 0x3070
movl %eax, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
jge 0x3ef6
movq -0x18(%rbp), %rdi
callq 0x3310
movq -0x8(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x50(%rbp)
callq 0x32b0
movl (%rax), %edi
callq 0x3230
movq -0x58(%rbp), %rdi
movq -0x50(%rbp), %rdx
movq %rax, %rcx
leaq 0x2f284(%rip), %rsi     # 0x33173
movb $0x0, %al
callq 0xbb10
movq -0x18(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
xorl %edx, %edx
callq 0x30f0
cmpl $0x0, %eax
jge 0x3f48
movq -0x18(%rbp), %rdi
callq 0x3310
movq -0x8(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x60(%rbp)
callq 0x32b0
movl (%rax), %edi
callq 0x3230
movq -0x68(%rbp), %rdi
movq -0x60(%rbp), %rdx
movq %rax, %rcx
leaq 0x2f215(%rip), %rsi     # 0x33156
movb $0x0, %al
callq 0xbb10
movl -0x24(%rbp), %eax
addl $0x1, %eax
movslq %eax, %rdi
callq 0x3150
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x3f7c
movq -0x18(%rbp), %rdi
callq 0x3310
movq -0x8(%rbp), %rdi
leaq 0x2f21b(%rip), %rsi     # 0x33190
movb $0x0, %al
callq 0xbb10
movq -0x20(%rbp), %rdi
movslq -0x24(%rbp), %rdx
movq -0x18(%rbp), %rcx
movl $0x1, %esi
callq 0x32a0
movl %eax, -0x28(%rbp)
movl -0x28(%rbp), %eax
cmpl -0x24(%rbp), %eax
je 0x3fe4
movq -0x20(%rbp), %rdi
callq 0x31c0
movq -0x18(%rbp), %rdi
callq 0x3310
movq -0x8(%rbp), %rax
movq %rax, -0x78(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x70(%rbp)
callq 0x32b0
movl (%rax), %edi
callq 0x3230
movq -0x78(%rbp), %rdi
movq -0x70(%rbp), %rdx
movq %rax, %rcx
leaq 0x2f1c1(%rip), %rsi     # 0x3319e
movb $0x0, %al
callq 0xbb10
movq -0x20(%rbp), %rax
movslq -0x24(%rbp), %rcx
movb $0x0, (%rax,%rcx)
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x13880
movq -0x20(%rbp), %rdi
callq 0x31c0
movq -0x18(%rbp), %rdi
callq 0x3310
addq $0x80, %rsp
popq %rbp
retq
nopl (%rax,%rax)