// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/src/fmtutil-advfile.c
// Function: de_advfile_run_applesd
static void de_advfile_run_applesd(deark *c, struct de_advfile *advf, int is_appledouble)
{
	de_ucstring *fname = NULL;
	struct de_advfile_cbparams *afp_main = NULL;
	struct de_advfile_cbparams *afp_rsrc = NULL;
	dbuf *outf = NULL;
	i64 cur_data_pos;
	size_t num_entries = 0;
	size_t k;
	char commentstr[80];
	size_t comment_strlen;
	struct applesd_entry entry_info[16];

	fname = ucstring_create(c);
	ucstring_append_ucstring(fname, advf->filename);
	if(fname->len<1) {
		ucstring_append_sz(fname, "_", DE_ENCODING_LATIN1);
	}
	if(is_appledouble) {
		// TODO: Consider using "._" prefix when writing to ZIP/tar
		ucstring_append_sz(fname, ".adf", DE_ENCODING_LATIN1);
	}
	else {
		ucstring_append_sz(fname, ".as", DE_ENCODING_LATIN1);
	}
	de_finfo_set_name_from_ucstring(c, advf->mainfork.fi, fname, advf->snflags);
	advf->mainfork.fi->original_filename_flag = advf->original_filename_flag;
	outf = dbuf_create_output_file(c, NULL, advf->mainfork.fi, advf->createflags);
	if(advf->enable_wbuffer) dbuf_enable_wbuffer(outf);

	if(is_appledouble) { // signature
		dbuf_writeu32be(outf, 0x00051607U);
	}
	else {
		dbuf_writeu32be(outf, 0x00051600U);
	}
	dbuf_writeu32be(outf, 0x00020000U); // version
	dbuf_write_zeroes(outf, 16); // filler

	// Decide what entries we will write, and in what order, and their data length.

	de_snprintf(commentstr, sizeof(commentstr), "Apple%s container generated by Deark",
		is_appledouble?"Double":"Single");
	comment_strlen = de_strlen(commentstr);

	if(advf->orig_filename) {
		entry_info[num_entries].id = SDID_REALNAME;
		entry_info[num_entries].len = (i64)advf->orig_filename_len;
		num_entries++;
	}

	entry_info[num_entries].id = SDID_COMMENT;
	entry_info[num_entries].len = (i64)comment_strlen;
	num_entries++;

	if(advf->mainfork.fi->timestamp[DE_TIMESTAMPIDX_CREATE].is_valid ||
		advf->mainfork.fi->timestamp[DE_TIMESTAMPIDX_MODIFY].is_valid ||
		advf->mainfork.fi->timestamp[DE_TIMESTAMPIDX_BACKUP].is_valid ||
		advf->mainfork.fi->timestamp[DE_TIMESTAMPIDX_ACCESS].is_valid)
	{
		entry_info[num_entries].id = SDID_FILEDATES;
		entry_info[num_entries].len = 16;
		num_entries++;
	}
	if((advf->has_typecode || advf->has_creatorcode || advf->has_finderflags) &&
		!advf->mainfork.fi->is_directory)
	{
		entry_info[num_entries].id = SDID_FINDERINFO;
		entry_info[num_entries].len = 32;
		num_entries++;
	}
	if(advf->rsrcfork.fork_exists) {
		entry_info[num_entries].id = SDID_RESOURCEFORK;
		entry_info[num_entries].len = advf->rsrcfork.fork_len;
		num_entries++;
	};
	if(advf->mainfork.fork_exists && !is_appledouble) {
		entry_info[num_entries].id = SDID_DATAFORK;
		entry_info[num_entries].len = advf->mainfork.fork_len;
		num_entries++;
	};

	dbuf_writeu16be(outf, (i64)num_entries);

	// Figure out where the each data element will be written.
	cur_data_pos = 26 + 12*(i64)num_entries;
	for(k=0; k<num_entries; k++) {
		entry_info[k].offset = cur_data_pos;
		cur_data_pos += entry_info[k].len;
	};

	// Write the element table
	for(k=0; k<num_entries; k++) {
		dbuf_writeu32be(outf, (i64)entry_info[k].id);
		if(entry_info[k].offset>0xffffffffLL || entry_info[k].len>0xffffffffLL) {
			de_err(c, "File too large to write to AppleSingle/AppleDouble format");
			goto done;
		}
		dbuf_writeu32be(outf, entry_info[k].offset);
		dbuf_writeu32be(outf, entry_info[k].len);
	}

	// Write the elements' data
	for(k=0; k<num_entries; k++) {
		switch(entry_info[k].id) {
		case SDID_DATAFORK:
			afp_main = de_malloc(c, sizeof(struct de_advfile_cbparams));
			afp_main->whattodo = DE_ADVFILE_WRITEMAIN;
			dbuf_set_writelistener(outf, advf->mainfork.writelistener_cb,
				advf->mainfork.userdata_for_writelistener);
			afp_main->outf = outf;
			if(advf->writefork_cbfn && advf->mainfork.fork_len>0) {
				advf->writefork_cbfn(c, advf, afp_main);
			}
			dbuf_set_writelistener(outf, NULL, NULL);
			break;

		case SDID_RESOURCEFORK:
			afp_rsrc = de_malloc(c, sizeof(struct de_advfile_cbparams));
			afp_rsrc->whattodo = DE_ADVFILE_WRITERSRC;
			dbuf_set_writelistener(outf, advf->rsrcfork.writelistener_cb,
				advf->rsrcfork.userdata_for_writelistener);
			afp_rsrc->outf = outf;
			if(advf->writefork_cbfn && advf->rsrcfork.fork_len>0) {
				advf->writefork_cbfn(c, advf, afp_rsrc);
			}
			dbuf_set_writelistener(outf, NULL, NULL);
			break;

		case SDID_REALNAME:
			// If you think this code might be wrong, first review the comments
			// in applesd.c regarding Pascal strings.
			dbuf_write(outf, advf->orig_filename, (i64)advf->orig_filename_len);
			break;

		case SDID_COMMENT:
			dbuf_write(outf, (const u8*)commentstr, (i64)comment_strlen);
			break;

		case SDID_FILEDATES:
			dbuf_writei32be(outf, timestamp_to_applesd_date(c, &advf->mainfork.fi->timestamp[DE_TIMESTAMPIDX_CREATE]));
			dbuf_writei32be(outf, timestamp_to_applesd_date(c, &advf->mainfork.fi->timestamp[DE_TIMESTAMPIDX_MODIFY]));
			dbuf_writei32be(outf, timestamp_to_applesd_date(c, &advf->mainfork.fi->timestamp[DE_TIMESTAMPIDX_BACKUP]));
			dbuf_writei32be(outf, timestamp_to_applesd_date(c, &advf->mainfork.fi->timestamp[DE_TIMESTAMPIDX_ACCESS]));
			break;

		case SDID_FINDERINFO:
			if(advf->has_typecode)
				dbuf_write(outf, advf->typecode, 4);
			else
				dbuf_write_zeroes(outf, 4);
			if(advf->has_creatorcode)
				dbuf_write(outf, advf->creatorcode, 4);
			else
				dbuf_write_zeroes(outf, 4);
			dbuf_writeu16be(outf, advf->has_finderflags?((i64)advf->finderflags):0);
			dbuf_write_zeroes(outf, 6 + 16);
			break;
		}

		// In case something went wrong, try to make sure we're at the expected
		// file position.
		// Note: This might not compensate for all failures, as dbuf_truncate
		// might not be fully implemented for this output type.
		dbuf_truncate(outf, entry_info[k].offset + entry_info[k].len);
	}

done:
	dbuf_close(outf);
	de_free(c, afp_main);
	de_free(c, afp_rsrc);
	ucstring_destroy(fname);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x270, %rsp            # imm = 0x270
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq $0x0, -0x20(%rbp)
movq $0x0, -0x28(%rbp)
movq $0x0, -0x30(%rbp)
movq $0x0, -0x38(%rbp)
movq $0x0, -0x48(%rbp)
movq -0x8(%rbp), %rdi
callq 0x1711d0
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x68(%rax), %rsi
callq 0x171460
movq -0x20(%rbp), %rax
cmpq $0x1, 0x10(%rax)
jge 0x17afac
movq -0x20(%rbp), %rdi
leaq 0x3ba64(%rip), %rsi     # 0x1b6a06
movl $0x5, %edx
callq 0x1715e0
cmpl $0x0, -0x14(%rbp)
je 0x17afc9
movq -0x20(%rbp), %rdi
leaq 0x5b910(%rip), %rsi     # 0x1d68cd
movl $0x5, %edx
callq 0x1715e0
jmp 0x17afde
movq -0x20(%rbp), %rdi
leaq 0x5b8fe(%rip), %rsi     # 0x1d68d2
movl $0x5, %edx
callq 0x1715e0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rsi
movq -0x20(%rbp), %rdx
movq -0x10(%rbp), %rax
movl 0x70(%rax), %ecx
callq 0x15d2c0
movq -0x10(%rbp), %rax
movb 0x79(%rax), %cl
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movb %cl, 0x8(%rax)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rdx
movq -0x10(%rbp), %rax
movl 0x74(%rax), %ecx
xorl %eax, %eax
movl %eax, %esi
callq 0x166c60
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rax
cmpb $0x0, 0x78(%rax)
je 0x17b03f
movq -0x38(%rbp), %rdi
callq 0x167b90
cmpl $0x0, -0x14(%rbp)
je 0x17b055
movq -0x38(%rbp), %rdi
movl $0x51607, %esi          # imm = 0x51607
callq 0x168b80
jmp 0x17b063
movq -0x38(%rbp), %rdi
movl $0x51600, %esi          # imm = 0x51600
callq 0x168b80
movq -0x38(%rbp), %rdi
movl $0x20000, %esi          # imm = 0x20000
callq 0x168b80
movq -0x38(%rbp), %rdi
movl $0x10, %esi
callq 0x1685f0
leaq -0xa0(%rbp), %rdi
movl -0x14(%rbp), %edx
leaq 0x277f3(%rip), %rcx     # 0x1a2883
leaq 0x277b4(%rip), %rax     # 0x1a284b
cmpl $0x0, %edx
cmovneq %rax, %rcx
movl $0x50, %esi
leaq 0x5b82c(%rip), %rdx     # 0x1d68d6
movb $0x0, %al
callq 0x15a980
leaq -0xa0(%rbp), %rdi
callq 0x190e0
movq %rax, -0xa8(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x88(%rax)
je 0x17b111
leaq -0x230(%rbp), %rax
imulq $0x18, -0x48(%rbp), %rcx
addq %rcx, %rax
movl $0x3, (%rax)
movq -0x10(%rbp), %rax
movq 0x80(%rax), %rcx
leaq -0x230(%rbp), %rax
imulq $0x18, -0x48(%rbp), %rdx
addq %rdx, %rax
movq %rcx, 0x10(%rax)
movq -0x48(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x48(%rbp)
leaq -0x230(%rbp), %rax
imulq $0x18, -0x48(%rbp), %rcx
addq %rcx, %rax
movl $0x4, (%rax)
movq -0xa8(%rbp), %rcx
leaq -0x230(%rbp), %rax
imulq $0x18, -0x48(%rbp), %rdx
addq %rdx, %rax
movq %rcx, 0x10(%rax)
movq -0x48(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x48(%rbp)
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movzbl 0x28(%rax), %eax
cmpl $0x0, %eax
jne 0x17b190
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movzbl 0x18(%rax), %eax
cmpl $0x0, %eax
jne 0x17b190
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movzbl 0x58(%rax), %eax
cmpl $0x0, %eax
jne 0x17b190
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movzbl 0x38(%rax), %eax
cmpl $0x0, %eax
je 0x17b1c8
leaq -0x230(%rbp), %rax
imulq $0x18, -0x48(%rbp), %rcx
addq %rcx, %rax
movl $0x8, (%rax)
leaq -0x230(%rbp), %rax
imulq $0x18, -0x48(%rbp), %rcx
addq %rcx, %rax
movq $0x10, 0x10(%rax)
movq -0x48(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x48(%rbp)
movq -0x10(%rbp), %rax
movzbl 0x7b(%rax), %eax
cmpl $0x0, %eax
jne 0x17b1ef
movq -0x10(%rbp), %rax
movzbl 0x7c(%rax), %eax
cmpl $0x0, %eax
jne 0x17b1ef
movq -0x10(%rbp), %rax
movzbl 0x7d(%rax), %eax
cmpl $0x0, %eax
je 0x17b235
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
cmpb $0x0, 0x9(%rax)
jne 0x17b235
leaq -0x230(%rbp), %rax
imulq $0x18, -0x48(%rbp), %rcx
addq %rcx, %rax
movl $0x9, (%rax)
leaq -0x230(%rbp), %rax
imulq $0x18, -0x48(%rbp), %rcx
addq %rcx, %rax
movq $0x20, 0x10(%rax)
movq -0x48(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x48(%rbp)
movq -0x10(%rbp), %rax
cmpb $0x0, 0x38(%rax)
je 0x17b27b
leaq -0x230(%rbp), %rax
imulq $0x18, -0x48(%rbp), %rcx
addq %rcx, %rax
movl $0x2, (%rax)
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rcx
leaq -0x230(%rbp), %rax
imulq $0x18, -0x48(%rbp), %rdx
addq %rdx, %rax
movq %rcx, 0x10(%rax)
movq -0x48(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x48(%rbp)
movq -0x10(%rbp), %rax
movzbl 0x10(%rax), %eax
cmpl $0x0, %eax
je 0x17b2ca
cmpl $0x0, -0x14(%rbp)
jne 0x17b2ca
leaq -0x230(%rbp), %rax
imulq $0x18, -0x48(%rbp), %rcx
addq %rcx, %rax
movl $0x1, (%rax)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rcx
leaq -0x230(%rbp), %rax
imulq $0x18, -0x48(%rbp), %rdx
addq %rdx, %rax
movq %rcx, 0x10(%rax)
movq -0x48(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x48(%rbp)
movq -0x38(%rbp), %rdi
movq -0x48(%rbp), %rsi
callq 0x168a50
imulq $0xc, -0x48(%rbp), %rax
addq $0x1a, %rax
movq %rax, -0x40(%rbp)
movq $0x0, -0x50(%rbp)
movq -0x50(%rbp), %rax
cmpq -0x48(%rbp), %rax
jae 0x17b336
movq -0x40(%rbp), %rcx
leaq -0x230(%rbp), %rax
imulq $0x18, -0x50(%rbp), %rdx
addq %rdx, %rax
movq %rcx, 0x8(%rax)
leaq -0x230(%rbp), %rax
imulq $0x18, -0x50(%rbp), %rcx
addq %rcx, %rax
movq 0x10(%rax), %rax
addq -0x40(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x50(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x50(%rbp)
jmp 0x17b2ec
movq $0x0, -0x50(%rbp)
movq -0x50(%rbp), %rax
cmpq -0x48(%rbp), %rax
jae 0x17b3fc
movq -0x38(%rbp), %rdi
leaq -0x230(%rbp), %rax
imulq $0x18, -0x50(%rbp), %rcx
addq %rcx, %rax
movl (%rax), %eax
movl %eax, %esi
callq 0x168b80
leaq -0x230(%rbp), %rax
imulq $0x18, -0x50(%rbp), %rcx
addq %rcx, %rax
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
cmpq %rcx, 0x8(%rax)
jg 0x17b39c
leaq -0x230(%rbp), %rax
imulq $0x18, -0x50(%rbp), %rcx
addq %rcx, %rax
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
cmpq %rcx, 0x10(%rax)
jle 0x17b3b3
movq -0x8(%rbp), %rdi
leaq 0x5b554(%rip), %rsi     # 0x1d68fb
movb $0x0, %al
callq 0x15bfb0
jmp 0x17b75a
movq -0x38(%rbp), %rdi
leaq -0x230(%rbp), %rax
imulq $0x18, -0x50(%rbp), %rcx
addq %rcx, %rax
movq 0x8(%rax), %rsi
callq 0x168b80
movq -0x38(%rbp), %rdi
leaq -0x230(%rbp), %rax
imulq $0x18, -0x50(%rbp), %rcx
addq %rcx, %rax
movq 0x10(%rax), %rsi
callq 0x168b80
movq -0x50(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x50(%rbp)
jmp 0x17b33e
movq $0x0, -0x50(%rbp)
movq -0x50(%rbp), %rax
cmpq -0x48(%rbp), %rax
jae 0x17b758
movq -0x50(%rbp), %rax
leaq (%rax,%rax,2), %rax
movl -0x230(%rbp,%rax,8), %eax
decl %eax
movl %eax, %ecx
movq %rcx, -0x238(%rbp)
subl $0x8, %eax
ja 0x17b718
movq -0x238(%rbp), %rax
leaq 0x5b459(%rip), %rcx     # 0x1d689c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x8(%rbp), %rdi
movl $0x10, %esi
callq 0x15b780
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movl $0x1, (%rax)
movq -0x38(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rsi
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rdx
callq 0x169280
movq -0x38(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x60(%rax)
je 0x17b4b9
movq -0x10(%rbp), %rax
cmpq $0x0, 0x18(%rax)
jle 0x17b4b9
movq -0x10(%rbp), %rax
movq 0x60(%rax), %rax
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x28(%rbp), %rdx
callq *%rax
movq -0x38(%rbp), %rdi
xorl %eax, %eax
movl %eax, %edx
movq %rdx, %rsi
callq 0x169280
jmp 0x17b718
movq -0x8(%rbp), %rdi
movl $0x10, %esi
callq 0x15b780
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movl $0x2, (%rax)
movq -0x38(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rsi
movq -0x10(%rbp), %rax
movq 0x50(%rax), %rdx
callq 0x169280
movq -0x38(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x60(%rax)
je 0x17b53b
movq -0x10(%rbp), %rax
cmpq $0x0, 0x40(%rax)
jle 0x17b53b
movq -0x10(%rbp), %rax
movq 0x60(%rax), %rax
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x30(%rbp), %rdx
callq *%rax
movq -0x38(%rbp), %rdi
xorl %eax, %eax
movl %eax, %edx
movq %rdx, %rsi
callq 0x169280
jmp 0x17b718
movq -0x38(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x88(%rax), %rsi
movq -0x10(%rbp), %rax
movq 0x80(%rax), %rdx
callq 0x166170
jmp 0x17b718
movq -0x38(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
movq -0xa8(%rbp), %rdx
callq 0x166170
jmp 0x17b718
movq -0x38(%rbp), %rax
movq %rax, -0x258(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rsi
addq $0x18, %rsi
addq $0x10, %rsi
callq 0x17bf50
movq -0x258(%rbp), %rdi
movq %rax, %rsi
callq 0x168cc0
movq -0x38(%rbp), %rax
movq %rax, -0x250(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rsi
addq $0x18, %rsi
callq 0x17bf50
movq -0x250(%rbp), %rdi
movq %rax, %rsi
callq 0x168cc0
movq -0x38(%rbp), %rax
movq %rax, -0x248(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rsi
addq $0x18, %rsi
addq $0x40, %rsi
callq 0x17bf50
movq -0x248(%rbp), %rdi
movq %rax, %rsi
callq 0x168cc0
movq -0x38(%rbp), %rax
movq %rax, -0x240(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rsi
addq $0x18, %rsi
addq $0x20, %rsi
callq 0x17bf50
movq -0x240(%rbp), %rdi
movq %rax, %rsi
callq 0x168cc0
jmp 0x17b718
movq -0x10(%rbp), %rax
cmpb $0x0, 0x7b(%rax)
je 0x17b682
movq -0x38(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0x90, %rsi
movl $0x4, %edx
callq 0x166170
jmp 0x17b690
movq -0x38(%rbp), %rdi
movl $0x4, %esi
callq 0x1685f0
movq -0x10(%rbp), %rax
cmpb $0x0, 0x7c(%rax)
je 0x17b6b5
movq -0x38(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0x94, %rsi
movl $0x4, %edx
callq 0x166170
jmp 0x17b6c3
movq -0x38(%rbp), %rdi
movl $0x4, %esi
callq 0x1685f0
movq -0x38(%rbp), %rax
movq %rax, -0x260(%rbp)
movq -0x10(%rbp), %rax
movzbl 0x7d(%rax), %eax
cmpl $0x0, %eax
je 0x17b6ec
movq -0x10(%rbp), %rax
movzwl 0x7e(%rax), %eax
movq %rax, -0x268(%rbp)
jmp 0x17b6f7
xorl %eax, %eax
movq %rax, -0x268(%rbp)
jmp 0x17b6f7
movq -0x260(%rbp), %rdi
movq -0x268(%rbp), %rsi
callq 0x168a50
movq -0x38(%rbp), %rdi
movl $0x16, %esi
callq 0x1685f0
movq -0x38(%rbp), %rdi
leaq -0x230(%rbp), %rax
imulq $0x18, -0x50(%rbp), %rcx
addq %rcx, %rax
movq 0x8(%rax), %rsi
leaq -0x230(%rbp), %rax
imulq $0x18, -0x50(%rbp), %rcx
addq %rcx, %rax
addq 0x10(%rax), %rsi
callq 0x168900
movq -0x50(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x50(%rbp)
jmp 0x17b404
jmp 0x17b75a
movq -0x38(%rbp), %rdi
callq 0x1676a0
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x15b820
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x15b820
movq -0x20(%rbp), %rdi
callq 0x171750
addq $0x270, %rsp            # imm = 0x270
popq %rbp
retq
nop