// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/tiff.c
// Function: do_dbg_print_numeric_values
static void do_dbg_print_numeric_values(deark *c, lctx *d, const struct taginfo *tg, const struct tagnuminfo *tni,
	de_ucstring *dbgline)
{
	i64 i;
	struct valdec_params vp;
	struct valdec_result vr;
	struct numeric_value nv;

	de_zeromem(&vr, sizeof(struct valdec_result));

	switch(tg->datatype) {
	case DATATYPE_BYTE: case DATATYPE_SBYTE:
	case DATATYPE_UNDEF: case DATATYPE_ASCII: case DATATYPE_UTF8:
	case DATATYPE_UINT16: case DATATYPE_SINT16:
	case DATATYPE_UINT32: case DATATYPE_SINT32: case DATATYPE_IFD32:
	case DATATYPE_UINT64: case DATATYPE_SINT64: case DATATYPE_IFD64:
	case DATATYPE_RATIONAL: case DATATYPE_SRATIONAL:
	case DATATYPE_FLOAT32: case DATATYPE_FLOAT64:
		break;
	default:
		goto done; // Not a supported numeric datatype
	}

	ucstring_append_sz(dbgline, " {", DE_ENCODING_LATIN1);

	// Populate the fields of vp/vr that don't change.
	vp.d = d;
	vp.tg = tg;
	vr.s = ucstring_create(c);

	for(i=0; i<tg->valcount && i<DE_TIFF_MAX_VALUES_TO_PRINT; i++) {
		read_numeric_value(c, d, tg, i, &nv, dbgline);

		// If possible, decode the value and print its name.
		if(nv.isvalid && tni->vdfn) {
			// Set the remaining fields of vp/vr.
			vp.idx = i;
			vp.n = nv.val_int64;
			ucstring_empty(vr.s);

			if(tni->vdfn(c, &vp, &vr)) {
				ucstring_append_sz(dbgline, "(=", DE_ENCODING_LATIN1);
				ucstring_append_ucstring(dbgline, vr.s);
				ucstring_append_sz(dbgline, ")", DE_ENCODING_LATIN1);
			}
		}

		if(i<tg->valcount-1) {
			ucstring_append_sz(dbgline, ",", DE_ENCODING_LATIN1);
		}
	}
	if(tg->valcount>DE_TIFF_MAX_VALUES_TO_PRINT) {
		ucstring_append_sz(dbgline, "...", DE_ENCODING_LATIN1);
	}
	ucstring_append_sz(dbgline, "}", DE_ENCODING_LATIN1);
done:
	if(vr.s) ucstring_destroy(vr.s);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq $0x0, -0x58(%rbp)
movq -0x18(%rbp), %rax
movl 0xc(%rax), %eax
movl %eax, -0x74(%rbp)
decl %eax
subl $0xd, %eax
jb 0x134a53
jmp 0x134a3a
movl -0x74(%rbp), %eax
addl $-0x10, %eax
subl $0x3, %eax
jb 0x134a53
jmp 0x134a47
movl -0x74(%rbp), %eax
subl $0x81, %eax
jne 0x134a55
jmp 0x134a53
jmp 0x134a5a
jmp 0x134bcb
movq -0x28(%rbp), %rdi
leaq 0x96bdf(%rip), %rsi     # 0x1cb644
movl $0x5, %edx
callq 0x1715e0
movq -0x10(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x8(%rbp), %rdi
callq 0x1711d0
movq %rax, -0x58(%rbp)
movq $0x0, -0x30(%rbp)
movq -0x30(%rbp), %rcx
movq -0x18(%rbp), %rdx
xorl %eax, %eax
cmpq 0x18(%rdx), %rcx
movb %al, -0x75(%rbp)
jge 0x134ab2
cmpq $0x64, -0x30(%rbp)
setl %al
movb %al, -0x75(%rbp)
movb -0x75(%rbp), %al
testb $0x1, %al
jne 0x134abe
jmp 0x134b96
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x30(%rbp), %rcx
movq -0x28(%rbp), %r9
leaq -0x70(%rbp), %r8
callq 0x133ab0
cmpl $0x0, -0x70(%rbp)
je 0x134b59
movq -0x20(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0x134b59
movq -0x30(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x68(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x58(%rbp), %rdi
callq 0x171210
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x8(%rbp), %rdi
leaq -0x50(%rbp), %rsi
leaq -0x58(%rbp), %rdx
callq *%rax
cmpl $0x0, %eax
je 0x134b57
movq -0x28(%rbp), %rdi
leaq 0x96b23(%rip), %rsi     # 0x1cb64e
movl $0x5, %edx
callq 0x1715e0
movq -0x28(%rbp), %rdi
movq -0x58(%rbp), %rsi
callq 0x171460
movq -0x28(%rbp), %rdi
leaq 0xa2ff9(%rip), %rsi     # 0x1d7b46
movl $0x5, %edx
callq 0x1715e0
jmp 0x134b59
movq -0x30(%rbp), %rax
movq -0x18(%rbp), %rcx
movq 0x18(%rcx), %rcx
subq $0x1, %rcx
cmpq %rcx, %rax
jge 0x134b83
movq -0x28(%rbp), %rdi
leaq 0x7b5f0(%rip), %rsi     # 0x1b0169
movl $0x5, %edx
callq 0x1715e0
jmp 0x134b85
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
jmp 0x134a94
movq -0x18(%rbp), %rax
cmpq $0x64, 0x18(%rax)
jle 0x134bb6
movq -0x28(%rbp), %rdi
leaq 0x9d49d(%rip), %rsi     # 0x1d2049
movl $0x5, %edx
callq 0x1715e0
movq -0x28(%rbp), %rdi
leaq 0x96a8b(%rip), %rsi     # 0x1cb64c
movl $0x5, %edx
callq 0x1715e0
cmpq $0x0, -0x58(%rbp)
je 0x134bdb
movq -0x58(%rbp), %rdi
callq 0x171750
addq $0x80, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)