// File: /workspace/github_c_makefile_star2_O0/TurkeyMcMac[P]ts3d/src/json-util.c
// Function: print_json_error
static void print_json_error(const json_reader *rdr,
	const struct json_item *item)
{
	const char *msg;
	struct json_reader_ctx *ctx = *json_get_ctx((json_reader *)rdr);
	int line = ctx->line;
	size_t bufsiz;
	char *buf;
	json_get_buf(rdr, &buf, &bufsiz);
	if (item->val.erridx < bufsiz) {
		char *left = buf + item->val.erridx;
		while ((left = memchr(left, '\n', bufsiz - (left - buf)))) {
			--line;
			++left;
		}
	}
	switch (item->type) {
	case JSON_ERROR_MEMORY:
		msg = "Out of memory";
		break;
	case JSON_ERROR_NUMBER_FORMAT:
		msg = "Invalid number format";
		break;
	case JSON_ERROR_TOKEN:
		msg = "Invalid token";
		break;
	case JSON_ERROR_EXPECTED_STRING:
		msg = "Expected string literal";
		break;
	case JSON_ERROR_EXPECTED_COLON:
		msg = "Expected colon";
		break;
	case JSON_ERROR_BRACKETS:
		msg = "Mismatched brackets";
		break;
	case JSON_ERROR_UNCLOSED_QUOTE:
		msg = "Unclosed quote";
		break;
	case JSON_ERROR_ESCAPE:
		msg = "Invalid escape sequence";
		break;
	case JSON_ERROR_CONTROL_CHAR:
		msg = "Raw control character present in string";
		break;
	case JSON_ERROR_EXPECTED_VALUE:
		msg = "Expected value";
		break;
	case JSON_ERROR_IO:
		msg = "Input reading failed";
		break;
	case JSON_ERROR_ERRNO:
		msg = strerror(errno);
		break;
	default:
		msg = "Unknown error";
		break;
	}
	logger_printf(ctx->log, LOGGER_ERROR,
		"JSON parse error in '%s', line %d: %s\n",
		ctx->name, line, msg);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
callq 0x7890
movq (%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movl 0x2010(%rax), %eax
movl %eax, -0x24(%rbp)
movq -0x8(%rbp), %rdi
leaq -0x38(%rbp), %rsi
leaq -0x30(%rbp), %rdx
callq 0x7840
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
cmpq -0x30(%rbp), %rax
jae 0x73ef
movq -0x38(%rbp), %rax
movq -0x10(%rbp), %rcx
addq 0x18(%rcx), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rdi
movq -0x30(%rbp), %rdx
movq -0x40(%rbp), %rax
movq -0x38(%rbp), %rcx
subq %rcx, %rax
subq %rax, %rdx
movl $0xa, %esi
callq 0x20d0
movq %rax, -0x40(%rbp)
cmpq $0x0, %rax
je 0x73ed
movl -0x24(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x24(%rbp)
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0x73ac
jmp 0x73ef
movq -0x10(%rbp), %rax
movl 0x10(%rax), %eax
addl $-0x9, %eax
movl %eax, %ecx
movq %rcx, -0x48(%rbp)
subl $0xb, %eax
ja 0x74c6
movq -0x48(%rbp), %rax
leaq 0x9fa5(%rip), %rcx      # 0x113b8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x9fe1(%rip), %rax      # 0x11404
movq %rax, -0x18(%rbp)
jmp 0x74d1
leaq 0x9fdf(%rip), %rax      # 0x11412
movq %rax, -0x18(%rbp)
jmp 0x74d1
leaq 0x9fe5(%rip), %rax      # 0x11428
movq %rax, -0x18(%rbp)
jmp 0x74d1
leaq 0x9fe3(%rip), %rax      # 0x11436
movq %rax, -0x18(%rbp)
jmp 0x74d1
leaq 0x9fee(%rip), %rax      # 0x1144e
movq %rax, -0x18(%rbp)
jmp 0x74d1
leaq 0x9ff0(%rip), %rax      # 0x1145d
movq %rax, -0x18(%rbp)
jmp 0x74d1
leaq 0x9ff7(%rip), %rax      # 0x11471
movq %rax, -0x18(%rbp)
jmp 0x74d1
leaq 0x9ff9(%rip), %rax      # 0x11480
movq %rax, -0x18(%rbp)
jmp 0x74d1
leaq 0xa004(%rip), %rax      # 0x11498
movq %rax, -0x18(%rbp)
jmp 0x74d1
leaq 0xa01f(%rip), %rax      # 0x114c0
movq %rax, -0x18(%rbp)
jmp 0x74d1
leaq 0xa021(%rip), %rax      # 0x114cf
movq %rax, -0x18(%rbp)
jmp 0x74d1
callq 0x2320
movl (%rax), %edi
callq 0x2260
movq %rax, -0x18(%rbp)
jmp 0x74d1
leaq 0xa017(%rip), %rax      # 0x114e4
movq %rax, -0x18(%rbp)
movq -0x20(%rbp), %rax
movq 0x2018(%rax), %rdi
movq -0x20(%rbp), %rax
movq 0x2000(%rax), %rcx
movl -0x24(%rbp), %r8d
movq -0x18(%rbp), %r9
movl $0x4, %esi
leaq 0x9ff7(%rip), %rdx      # 0x114f2
movb $0x0, %al
callq 0xa260
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax,%rax)