// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/ole1.c
// Function: do_ole_object_linked
static int do_ole_object_linked(deark *c, lctx *d,
	i64 pos1, i64 len, int exact_size_known, i64 *bytes_consumed)
{
	i64 pos = pos1;
	i64 stringlen;
	i64 bytes_consumed2 = 0;
	int ret;
	struct de_stringreaderdata *classname_srd = NULL;
	struct de_stringreaderdata *topicname_srd = NULL;
	struct de_stringreaderdata *itemname_srd = NULL;
	struct de_stringreaderdata *networkname_srd = NULL;
	int retval = 0;

	stringlen = de_getu32le_p(&pos);
	classname_srd = dbuf_read_string(c->infile, pos, stringlen, 260, DE_CONVFLAG_STOP_AT_NUL,
		d->input_encoding);
	de_dbg(c, "embedded ClassName: \"%s\"", ucstring_getpsz(classname_srd->str));
	pos += stringlen;

	stringlen = de_getu32le_p(&pos);
	topicname_srd = dbuf_read_string(c->infile, pos, stringlen, 260, DE_CONVFLAG_STOP_AT_NUL,
		d->input_encoding);
	de_dbg(c, "TopicName/filename: \"%s\"", ucstring_getpsz(topicname_srd->str));
	pos += stringlen;

	stringlen = de_getu32le_p(&pos);
	itemname_srd = dbuf_read_string(c->infile, pos, stringlen, 260, DE_CONVFLAG_STOP_AT_NUL,
		d->input_encoding);
	de_dbg(c, "ItemName/params: \"%s\"", ucstring_getpsz(itemname_srd->str));
	pos += stringlen;

	stringlen = de_getu32le_p(&pos);
	networkname_srd = dbuf_read_string(c->infile, pos, stringlen, 260, DE_CONVFLAG_STOP_AT_NUL,
		d->input_encoding);
	de_dbg(c, "NetworkName: \"%s\"", ucstring_getpsz(networkname_srd->str));
	pos += stringlen;

	pos += 4; // reserved
	pos += 4; // LinkUpdateOption

	// Nested "presentation" object
	ret = do_ole_object(c, d, pos, pos1+len-pos, exact_size_known, 1,
		&bytes_consumed2);
	if(!ret) goto done;
	pos += bytes_consumed2;

	*bytes_consumed = pos-pos1;
	retval = 1;

done:
	de_destroy_stringreaderdata(c, classname_srd);
	de_destroy_stringreaderdata(c, topicname_srd);
	de_destroy_stringreaderdata(c, itemname_srd);
	de_destroy_stringreaderdata(c, networkname_srd);
	return retval;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movl %r8d, -0x24(%rbp)
movq %r9, -0x30(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x38(%rbp)
movq $0x0, -0x48(%rbp)
movq $0x0, -0x58(%rbp)
movq $0x0, -0x60(%rbp)
movq $0x0, -0x68(%rbp)
movq $0x0, -0x70(%rbp)
movl $0x0, -0x74(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x38(%rbp), %rsi
callq 0x165580
movq %rax, -0x40(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x38(%rbp), %rsi
movq -0x40(%rbp), %rdx
movq -0x10(%rbp), %rax
movl (%rax), %r9d
movl $0x104, %ecx            # imm = 0x104
movl $0x1, %r8d
callq 0x1664c0
movq %rax, -0x58(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x98(%rbp)
movq -0x58(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x172500
movq -0x98(%rbp), %rdi
movq %rax, %rdx
leaq 0xd58b2(%rip), %rsi     # 0x1bd515
movb $0x0, %al
callq 0x15b0d0
movq -0x40(%rbp), %rax
addq -0x38(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x38(%rbp), %rsi
callq 0x165580
movq %rax, -0x40(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x38(%rbp), %rsi
movq -0x40(%rbp), %rdx
movq -0x10(%rbp), %rax
movl (%rax), %r9d
movl $0x104, %ecx            # imm = 0x104
movl $0x1, %r8d
callq 0x1664c0
movq %rax, -0x60(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x90(%rbp)
movq -0x60(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x172500
movq -0x90(%rbp), %rdi
movq %rax, %rdx
leaq 0xd584f(%rip), %rsi     # 0x1bd52e
movb $0x0, %al
callq 0x15b0d0
movq -0x40(%rbp), %rax
addq -0x38(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x38(%rbp), %rsi
callq 0x165580
movq %rax, -0x40(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x38(%rbp), %rsi
movq -0x40(%rbp), %rdx
movq -0x10(%rbp), %rax
movl (%rax), %r9d
movl $0x104, %ecx            # imm = 0x104
movl $0x1, %r8d
callq 0x1664c0
movq %rax, -0x68(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x88(%rbp)
movq -0x68(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x172500
movq -0x88(%rbp), %rdi
movq %rax, %rdx
leaq 0xd57ec(%rip), %rsi     # 0x1bd547
movb $0x0, %al
callq 0x15b0d0
movq -0x40(%rbp), %rax
addq -0x38(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x38(%rbp), %rsi
callq 0x165580
movq %rax, -0x40(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x38(%rbp), %rsi
movq -0x40(%rbp), %rdx
movq -0x10(%rbp), %rax
movl (%rax), %r9d
movl $0x104, %ecx            # imm = 0x104
movl $0x1, %r8d
callq 0x1664c0
movq %rax, -0x70(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x80(%rbp)
movq -0x70(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x172500
movq -0x80(%rbp), %rdi
movq %rax, %rdx
leaq 0xd578c(%rip), %rsi     # 0x1bd55d
movb $0x0, %al
callq 0x15b0d0
movq -0x40(%rbp), %rax
addq -0x38(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x38(%rbp), %rdx
movq -0x18(%rbp), %rcx
addq -0x20(%rbp), %rcx
subq -0x38(%rbp), %rcx
movl -0x24(%rbp), %r8d
movl $0x1, %r9d
leaq -0x48(%rbp), %rax
movq %rax, (%rsp)
callq 0xe76d0
movl %eax, -0x4c(%rbp)
cmpl $0x0, -0x4c(%rbp)
jne 0xe7e36
jmp 0xe7e58
movq -0x48(%rbp), %rax
addq -0x38(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rcx
subq -0x18(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, (%rax)
movl $0x1, -0x74(%rbp)
movq -0x8(%rbp), %rdi
movq -0x58(%rbp), %rsi
callq 0x166830
movq -0x8(%rbp), %rdi
movq -0x60(%rbp), %rsi
callq 0x166830
movq -0x8(%rbp), %rdi
movq -0x68(%rbp), %rsi
callq 0x166830
movq -0x8(%rbp), %rdi
movq -0x70(%rbp), %rsi
callq 0x166830
movl -0x74(%rbp), %eax
addq $0xa0, %rsp
popq %rbp
retq
nopl (%rax,%rax)