// File: Alcaro[P]bridges/arlib/zip.cpp
// Function: fromcp437(string)
static string fromcp437(string in)
{
	for (uint8_t b : in.bytes())
	{
		if (b < 0x20 || b >= 0x7F) goto slow;
	}
	return in;
	
slow:
	string out;
	for (uint8_t b : in.bytes())
	{
		out += string::codepoint(cp437[b]);
	}
	return out;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x120, %rsp            # imm = 0x120
movq %rsi, -0x110(%rbp)
movq %rdi, -0x108(%rbp)
movq %rdi, %rax
movq %rax, -0x100(%rbp)
movq %rdi, -0x68(%rbp)
movq %rsi, -0x70(%rbp)
leaq -0x88(%rbp), %rax
movq %rax, -0x48(%rbp)
movq %rsi, -0x50(%rbp)
movq -0x50(%rbp), %rax
leaq -0x88(%rbp), %rcx
movq %rcx, -0x38(%rbp)
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movq %rax, -0xf8(%rbp)
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
callq 0x5cc0
movsbl %al, %eax
cmpl $0x0, %eax
jl 0x43b21
movq -0xf8(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rdi
callq 0x5cc0
movq -0xf8(%rbp), %rsi
movsbl %al, %eax
xorl $0xf, %eax
movzbl %al, %eax
movl %eax, %edx
leaq -0x88(%rbp), %rdi
callq 0x5ed0
jmp 0x43b3c
movq -0xf8(%rbp), %rax
movq (%rax), %rsi
movl 0x8(%rax), %eax
movl %eax, %edx
leaq -0x88(%rbp), %rdi
callq 0x5ed0
leaq -0x88(%rbp), %rax
movq %rax, -0x78(%rbp)
movq -0x78(%rbp), %rdi
callq 0x45be0
movq %rax, -0x90(%rbp)
movq -0x78(%rbp), %rdi
callq 0x45c00
movq %rax, -0x98(%rbp)
movq -0x90(%rbp), %rax
cmpq -0x98(%rbp), %rax
je 0x43bb6
movq -0x90(%rbp), %rax
movb (%rax), %al
movb %al, -0x99(%rbp)
movzbl -0x99(%rbp), %eax
cmpl $0x20, %eax
jl 0x43b9e
movzbl -0x99(%rbp), %eax
cmpl $0x7f, %eax
jl 0x43ba0
jmp 0x43bce
jmp 0x43ba2
movq -0x90(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x90(%rbp)
jmp 0x43b67
movq -0x110(%rbp), %rsi
movq -0x108(%rbp), %rdi
callq 0x5d40
jmp 0x43d67
movq -0x108(%rbp), %rdi
movb $0x0, -0x9a(%rbp)
callq 0x7800
movq -0x110(%rbp), %rax
leaq -0xb8(%rbp), %rcx
movq %rcx, -0x58(%rbp)
movq %rax, -0x60(%rbp)
movq -0x60(%rbp), %rax
leaq -0xb8(%rbp), %rcx
movq %rcx, -0x28(%rbp)
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x118(%rbp)
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
callq 0x5cc0
movsbl %al, %eax
cmpl $0x0, %eax
jl 0x43c5e
movq -0x118(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rdi
callq 0x5cc0
movq -0x118(%rbp), %rsi
movsbl %al, %eax
xorl $0xf, %eax
movzbl %al, %eax
movl %eax, %edx
leaq -0xb8(%rbp), %rdi
callq 0x5ed0
jmp 0x43c79
movq -0x118(%rbp), %rax
movq (%rax), %rsi
movl 0x8(%rax), %eax
movl %eax, %edx
leaq -0xb8(%rbp), %rdi
callq 0x5ed0
leaq -0xb8(%rbp), %rax
movq %rax, -0xa8(%rbp)
movq -0xa8(%rbp), %rdi
callq 0x45be0
movq %rax, -0xc0(%rbp)
movq -0xa8(%rbp), %rdi
callq 0x45c00
movq %rax, -0xc8(%rbp)
movq -0xc0(%rbp), %rax
cmpq -0xc8(%rbp), %rax
je 0x43d49
movq -0xc0(%rbp), %rax
movb (%rax), %al
movb %al, -0xc9(%rbp)
movzbl -0xc9(%rbp), %eax
movl %eax, %ecx
leaq 0x20320(%rip), %rax     # 0x64000
movzwl (%rax,%rcx,2), %esi
leaq -0xf0(%rbp), %rdi
callq 0x3d160
movq -0x108(%rbp), %rdi
movq -0xf0(%rbp), %rax
movq %rax, -0xe0(%rbp)
movq -0xe8(%rbp), %rax
movq %rax, -0xd8(%rbp)
movq -0xe0(%rbp), %rsi
movq -0xd8(%rbp), %rdx
callq 0x5e00
leaq -0xf0(%rbp), %rdi
callq 0x5870
movq -0xc0(%rbp), %rax
addq $0x1, %rax
movq %rax, -0xc0(%rbp)
jmp 0x43cad
movb $0x1, -0x9a(%rbp)
testb $0x1, -0x9a(%rbp)
jne 0x43d65
movq -0x108(%rbp), %rdi
callq 0x5870
jmp 0x43d67
movq -0x100(%rbp), %rax
addq $0x120, %rsp            # imm = 0x120
popq %rbp
retq
nopw (%rax,%rax)