// File: Alcaro[P]bridges/gamemap.cpp
// Function: serialize_fill(gamemap&, char*, int, int, int)
static void serialize_fill(gamemap& map, char * ret, int width, int x, int y)
{
	if (map.map[y][x].bridges[0] == 3 && ret[(width+1)*y+(x+1)] == '\0')
	{
		ret[(width+1)*y+(x+1)] = '<';
		serialize_fill(map, ret, width, x+1, y);
	}
	if (map.map[y][x].bridges[1] == 3 && ret[(width+1)*(y-1)+x] == '\0')
	{
		ret[(width+1)*(y-1)+x] = 'v';
		serialize_fill(map, ret, width, x, y-1);
	}
	if (map.map[y][x].bridges[2] == 3 && ret[(width+1)*y+(x-1)] == '\0')
	{
		ret[(width+1)*y+(x-1)] = '>';
		serialize_fill(map, ret, width, x-1, y);
	}
	if (map.map[y][x].bridges[3] == 3 && ret[(width+1)*(y+1)+x] == '\0')
	{
		ret[(width+1)*(y+1)+x] = '^';
		serialize_fill(map, ret, width, x, y+1);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movl %ecx, -0x18(%rbp)
movl %r8d, -0x1c(%rbp)
movq -0x8(%rbp), %rax
addq $0xc, %rax
movslq -0x1c(%rbp), %rcx
imulq $0x4b0, %rcx, %rcx      # imm = 0x4B0
addq %rcx, %rax
movslq -0x18(%rbp), %rcx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movzbl 0x8(%rax), %eax
cmpl $0x3, %eax
jne 0x4fb3d
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
addl $0x1, %ecx
imull -0x1c(%rbp), %ecx
movl -0x18(%rbp), %edx
addl $0x1, %edx
addl %edx, %ecx
movslq %ecx, %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x0, %eax
jne 0x4fb3d
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
addl $0x1, %ecx
imull -0x1c(%rbp), %ecx
movl -0x18(%rbp), %edx
addl $0x1, %edx
addl %edx, %ecx
movslq %ecx, %rcx
movb $0x3c, (%rax,%rcx)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl -0x14(%rbp), %edx
movl -0x18(%rbp), %ecx
addl $0x1, %ecx
movl -0x1c(%rbp), %r8d
callq 0x4faa0
movq -0x8(%rbp), %rax
addq $0xc, %rax
movslq -0x1c(%rbp), %rcx
imulq $0x4b0, %rcx, %rcx      # imm = 0x4B0
addq %rcx, %rax
movslq -0x18(%rbp), %rcx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movzbl 0x9(%rax), %eax
cmpl $0x3, %eax
jne 0x4fbc1
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
addl $0x1, %ecx
movl -0x1c(%rbp), %edx
subl $0x1, %edx
imull %edx, %ecx
addl -0x18(%rbp), %ecx
movslq %ecx, %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x0, %eax
jne 0x4fbc1
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
addl $0x1, %ecx
movl -0x1c(%rbp), %edx
subl $0x1, %edx
imull %edx, %ecx
addl -0x18(%rbp), %ecx
movslq %ecx, %rcx
movb $0x76, (%rax,%rcx)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl -0x14(%rbp), %edx
movl -0x18(%rbp), %ecx
movl -0x1c(%rbp), %r8d
subl $0x1, %r8d
callq 0x4faa0
movq -0x8(%rbp), %rax
addq $0xc, %rax
movslq -0x1c(%rbp), %rcx
imulq $0x4b0, %rcx, %rcx      # imm = 0x4B0
addq %rcx, %rax
movslq -0x18(%rbp), %rcx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movzbl 0xa(%rax), %eax
cmpl $0x3, %eax
jne 0x4fc44
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
addl $0x1, %ecx
imull -0x1c(%rbp), %ecx
movl -0x18(%rbp), %edx
subl $0x1, %edx
addl %edx, %ecx
movslq %ecx, %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x0, %eax
jne 0x4fc44
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
addl $0x1, %ecx
imull -0x1c(%rbp), %ecx
movl -0x18(%rbp), %edx
subl $0x1, %edx
addl %edx, %ecx
movslq %ecx, %rcx
movb $0x3e, (%rax,%rcx)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl -0x14(%rbp), %edx
movl -0x18(%rbp), %ecx
subl $0x1, %ecx
movl -0x1c(%rbp), %r8d
callq 0x4faa0
movq -0x8(%rbp), %rax
addq $0xc, %rax
movslq -0x1c(%rbp), %rcx
imulq $0x4b0, %rcx, %rcx      # imm = 0x4B0
addq %rcx, %rax
movslq -0x18(%rbp), %rcx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movzbl 0xb(%rax), %eax
cmpl $0x3, %eax
jne 0x4fcc8
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
addl $0x1, %ecx
movl -0x1c(%rbp), %edx
addl $0x1, %edx
imull %edx, %ecx
addl -0x18(%rbp), %ecx
movslq %ecx, %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x0, %eax
jne 0x4fcc8
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
addl $0x1, %ecx
movl -0x1c(%rbp), %edx
addl $0x1, %edx
imull %edx, %ecx
addl -0x18(%rbp), %ecx
movslq %ecx, %rcx
movb $0x5e, (%rax,%rcx)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl -0x14(%rbp), %edx
movl -0x18(%rbp), %ecx
movl -0x1c(%rbp), %r8d
addl $0x1, %r8d
callq 0x4faa0
addq $0x20, %rsp
popq %rbp
retq
nop