// File: rpavlik[P]edid-decode/edid-decode.cpp
// Function: msg(bool, char const*, ...)
void msg(bool is_warn, const char *fmt, ...)
{
	char buf[1024] = "";
	va_list ap;

	va_start(ap, fmt);
	vsprintf(buf, fmt, ap);
	va_end(ap);

	if (is_warn)
		state.warnings++;
	else
		state.failures++;
	if (state.data_block.empty())
		s_msgs[state.block_nr][is_warn] += std::string("  ") + buf;
	else
		s_msgs[state.block_nr][is_warn] += "  " + state.data_block + ": " + buf;

	if (options[OptCheckInline])
		printf("%s: %s", is_warn ? "WARN" : "FAIL", buf);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x5c0, %rsp            # imm = 0x5C0
testb %al, %al
je 0x4817
movaps %xmm0, -0x570(%rbp)
movaps %xmm1, -0x560(%rbp)
movaps %xmm2, -0x550(%rbp)
movaps %xmm3, -0x540(%rbp)
movaps %xmm4, -0x530(%rbp)
movaps %xmm5, -0x520(%rbp)
movaps %xmm6, -0x510(%rbp)
movaps %xmm7, -0x500(%rbp)
movq %r9, -0x578(%rbp)
movq %r8, -0x580(%rbp)
movq %rcx, -0x588(%rbp)
movq %rdx, -0x590(%rbp)
movb %dil, %al
andb $0x1, %al
movb %al, -0x1(%rbp)
movq %rsi, -0x10(%rbp)
leaq -0x410(%rbp), %rdi
xorl %esi, %esi
movl $0x400, %edx            # imm = 0x400
callq 0x41c0
leaq -0x430(%rbp), %rax
leaq -0x5a0(%rbp), %rcx
movq %rcx, 0x10(%rax)
leaq 0x10(%rbp), %rcx
movq %rcx, 0x8(%rax)
movl $0x30, 0x4(%rax)
movl $0x10, (%rax)
leaq -0x410(%rbp), %rdi
movq -0x10(%rbp), %rsi
leaq -0x430(%rbp), %rdx
callq 0x41a0
leaq -0x430(%rbp), %rax
testb $0x1, -0x1(%rbp)
je 0x48ae
movl 0x47329(%rip), %eax     # 0x4bbcc
addl $0x1, %eax
movl %eax, 0x47320(%rip)     # 0x4bbcc
jmp 0x48bd
movl 0x4731c(%rip), %eax     # 0x4bbd0
addl $0x1, %eax
movl %eax, 0x47313(%rip)     # 0x4bbd0
leaq 0x4728c(%rip), %rdi     # 0x4bb50
addq $0x30, %rdi
callq 0x4510
testb $0x1, %al
jne 0x48d6
jmp 0x49dc
leaq -0x471(%rbp), %rdi
movq %rdi, -0x5a8(%rbp)
callq 0x4560
movq -0x5a8(%rbp), %rdx
leaq 0x2feea(%rip), %rsi     # 0x347e1
leaq -0x470(%rbp), %rdi
callq 0xb510
jmp 0x4905
leaq -0x450(%rbp), %rdi
leaq -0x470(%rbp), %rsi
leaq -0x410(%rbp), %rdx
callq 0xb4c0
jmp 0x4921
movl 0x47231(%rip), %eax     # 0x4bb58
shlq $0x6, %rax
leaq 0x47b9e(%rip), %rdi     # 0x4c4d0
addq %rax, %rdi
movzbl -0x1(%rbp), %eax
andl $0x1, %eax
shll $0x5, %eax
addq %rax, %rdi
leaq -0x450(%rbp), %rsi
callq 0x43f0
jmp 0x4950
leaq -0x450(%rbp), %rdi
callq 0x41f0
leaq -0x470(%rbp), %rdi
callq 0x41f0
leaq -0x471(%rbp), %rdi
callq 0x4370
jmp 0x4aea
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x480(%rbp)
movl %eax, -0x484(%rbp)
jmp 0x49cb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x480(%rbp)
movl %eax, -0x484(%rbp)
jmp 0x49bf
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x480(%rbp)
movl %eax, -0x484(%rbp)
leaq -0x450(%rbp), %rdi
callq 0x41f0
leaq -0x470(%rbp), %rdi
callq 0x41f0
leaq -0x471(%rbp), %rdi
callq 0x4370
jmp 0x4b3e
leaq 0x2fdfe(%rip), %rsi     # 0x347e1
leaq 0x47196(%rip), %rdx     # 0x4bb80
leaq -0x4e8(%rbp), %rdi
movq %rdi, -0x5b0(%rbp)
callq 0xb5c0
movq -0x5b0(%rbp), %rsi
leaq 0x3dd77(%rip), %rdx     # 0x42782
leaq -0x4c8(%rbp), %rdi
callq 0xb4c0
jmp 0x4a19
leaq -0x4a8(%rbp), %rdi
leaq -0x4c8(%rbp), %rsi
leaq -0x410(%rbp), %rdx
callq 0xb4c0
jmp 0x4a35
movl 0x4711d(%rip), %eax     # 0x4bb58
shlq $0x6, %rax
leaq 0x47a8a(%rip), %rdi     # 0x4c4d0
addq %rax, %rdi
movzbl -0x1(%rbp), %eax
andl $0x1, %eax
shll $0x5, %eax
addq %rax, %rdi
leaq -0x4a8(%rbp), %rsi
callq 0x43f0
jmp 0x4a64
leaq -0x4a8(%rbp), %rdi
callq 0x41f0
leaq -0x4c8(%rbp), %rdi
callq 0x41f0
leaq -0x4e8(%rbp), %rdi
callq 0x41f0
jmp 0x4aea
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x480(%rbp)
movl %eax, -0x484(%rbp)
jmp 0x4adc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x480(%rbp)
movl %eax, -0x484(%rbp)
jmp 0x4ad0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x480(%rbp)
movl %eax, -0x484(%rbp)
leaq -0x4a8(%rbp), %rdi
callq 0x41f0
leaq -0x4c8(%rbp), %rdi
callq 0x41f0
leaq -0x4e8(%rbp), %rdi
callq 0x41f0
jmp 0x4b3e
cmpb $0x0, 0x4ba62(%rip)     # 0x50553
je 0x4b35
testb $0x1, -0x1(%rbp)
je 0x4b09
leaq 0x2a736(%rip), %rax     # 0x2f236
movq %rax, -0x5b8(%rbp)
jmp 0x4b19
leaq 0x2a72b(%rip), %rax     # 0x2f23b
movq %rax, -0x5b8(%rbp)
jmp 0x4b19
movq -0x5b8(%rbp), %rsi
leaq -0x410(%rbp), %rdx
leaq 0x2a701(%rip), %rdi     # 0x2f22f
movb $0x0, %al
callq 0x4050
addq $0x5c0, %rsp            # imm = 0x5C0
popq %rbp
retq
movq -0x480(%rbp), %rdi
callq 0x4550
nopw (%rax,%rax)