// File: /workspace/github_c_makefile_star2_O0/cath-mawr[P]rscmapgen/mapdump.c
// Function: load_chunk
int
load_chunk(struct chunk *c, unsigned x, unsigned y, unsigned z)
{
	FILE *f;
	char name[128];

	snprintf(name, sizeof(name), "./Map/%u-%u-%u.dat", x, y, z);
	f = fopen(name, "rb");
	if (f == NULL) {
		if (errno == ENOENT) {
			memset(c->overlays[z], 2, sizeof(c->overlays[z]));
			return 0;
		}
		return 1;
	}
	puts(name);
	fread(c->colour[z], 1, CHUNKAREA, f);
	fread(c->elevation[z], 1, CHUNKAREA, f);
	fread(c->h_boundaries[z], 1, CHUNKAREA, f);
	fread(c->v_boundaries[z], 1, CHUNKAREA, f);
	fread(c->d_boundaries[z], 2, CHUNKAREA, f);
	fread(c->roofing[z], 1, CHUNKAREA, f);
	fread(c->overlays[z], 1, CHUNKAREA, f);
	fread(c->rotation[z], 1, CHUNKAREA, f);
	fclose(f);
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl %edx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
leaq -0xb0(%rbp), %rdi
movl -0x14(%rbp), %ecx
movl -0x18(%rbp), %r8d
movl -0x1c(%rbp), %r9d
movl $0x80, %esi
leaq 0x30e1a(%rip), %rdx     # 0x32040
movb $0x0, %al
callq 0x1090
leaq -0xb0(%rbp), %rdi
leaq 0x30e18(%rip), %rsi     # 0x32053
callq 0x10d0
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0x1294
callq 0x1040
cmpl $0x2, (%rax)
jne 0x1288
movq -0x10(%rbp), %rdi
addq $0xfc00, %rdi           # imm = 0xFC00
movl -0x1c(%rbp), %eax
imulq $0x900, %rax, %rax      # imm = 0x900
addq %rax, %rdi
movl $0x2, %esi
movl $0x900, %edx            # imm = 0x900
callq 0x10a0
movl $0x0, -0x4(%rbp)
jmp 0x1401
movl $0x1, -0x4(%rbp)
jmp 0x1401
leaq -0xb0(%rbp), %rdi
callq 0x1050
movq -0x10(%rbp), %rdi
addq $0x2400, %rdi           # imm = 0x2400
movl -0x1c(%rbp), %eax
imulq $0x900, %rax, %rax      # imm = 0x900
addq %rax, %rdi
movq -0x28(%rbp), %rcx
movl $0x1, %esi
movl $0x900, %edx            # imm = 0x900
callq 0x1060
movq -0x10(%rbp), %rdi
movl -0x1c(%rbp), %eax
imulq $0x900, %rax, %rax      # imm = 0x900
addq %rax, %rdi
movq -0x28(%rbp), %rcx
movl $0x1, %esi
movl $0x900, %edx            # imm = 0x900
callq 0x1060
movq -0x10(%rbp), %rdi
addq $0x6c00, %rdi           # imm = 0x6C00
movl -0x1c(%rbp), %eax
imulq $0x900, %rax, %rax      # imm = 0x900
addq %rax, %rdi
movq -0x28(%rbp), %rcx
movl $0x1, %esi
movl $0x900, %edx            # imm = 0x900
callq 0x1060
movq -0x10(%rbp), %rdi
addq $0x4800, %rdi           # imm = 0x4800
movl -0x1c(%rbp), %eax
imulq $0x900, %rax, %rax      # imm = 0x900
addq %rax, %rdi
movq -0x28(%rbp), %rcx
movl $0x1, %esi
movl $0x900, %edx            # imm = 0x900
callq 0x1060
movq -0x10(%rbp), %rdi
addq $0x9000, %rdi           # imm = 0x9000
movl -0x1c(%rbp), %eax
imulq $0x1200, %rax, %rax     # imm = 0x1200
addq %rax, %rdi
movq -0x28(%rbp), %rcx
movl $0x2, %esi
movl $0x900, %edx            # imm = 0x900
callq 0x1060
movq -0x10(%rbp), %rdi
addq $0xd800, %rdi           # imm = 0xD800
movl -0x1c(%rbp), %eax
imulq $0x900, %rax, %rax      # imm = 0x900
addq %rax, %rdi
movq -0x28(%rbp), %rcx
movl $0x1, %esi
movl $0x900, %edx            # imm = 0x900
callq 0x1060
movq -0x10(%rbp), %rdi
addq $0xfc00, %rdi           # imm = 0xFC00
movl -0x1c(%rbp), %eax
imulq $0x900, %rax, %rax      # imm = 0x900
addq %rax, %rdi
movq -0x28(%rbp), %rcx
movl $0x1, %esi
movl $0x900, %edx            # imm = 0x900
callq 0x1060
movq -0x10(%rbp), %rdi
addq $0x12000, %rdi          # imm = 0x12000
movl -0x1c(%rbp), %eax
imulq $0x900, %rax, %rax      # imm = 0x900
addq %rax, %rdi
movq -0x28(%rbp), %rcx
movl $0x1, %esi
movl $0x900, %edx            # imm = 0x900
callq 0x1060
movq -0x28(%rbp), %rdi
callq 0x1070
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0xb0, %rsp
popq %rbp
retq
nopl (%rax)