// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/src/fmtutil-lzw.c
// Function: delzw_process_data_code
static void delzw_process_data_code(delzwctx *dc, DELZW_CODE code)
{
	if(code >= dc->ct_capacity) {
		return;
	}

	if(!dc->have_oldcode) {
		// Special case for the first code.
		delzw_emit_code(dc, code);
		dc->oldcode = code;
		dc->have_oldcode = 1;
		dc->last_value = dc->ct[code].value;
		return;
	}

	if(delzw_code_is_in_table(dc, code)) {
		delzw_emit_code(dc, code);
		if(dc->errcode) return;

		// Let k = the first character of the translation of the code.
		// Add <oldcode>k to the dictionary.
		delzw_add_to_dict(dc, dc->oldcode, dc->last_value);
	}
	else {
		if(code>dc->free_code_search_start && !dc->has_partial_clearing && !dc->is_hashed) {
			if(dc->stop_on_invalid_code) {
				delzw_debugmsg(dc, 1, "bad code: %d when max=%d (assuming data stops here)",
					(int)code, (int)dc->free_code_search_start);
				delzw_stop(dc, "bad LZW code");
				return;
			}
			delzw_set_errorf(dc, DELZW_ERRCODE_BAD_CDATA, "Bad LZW code (%d when max=%d)",
				(int)code, (int)dc->free_code_search_start);
			return;
		}

		// Let k = the first char of the translation of oldcode.
		// Add <oldcode>k to the dictionary.
		delzw_add_to_dict(dc, dc->oldcode, dc->last_value);
		if(dc->errcode) return;

		// Write <oldcode>k to the output stream.
		delzw_emit_code(dc, dc->last_code_added);
	}

	dc->oldcode = code;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl -0xc(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0xc8(%rcx), %eax
jb 0x186063
jmp 0x1861df
movq -0x8(%rbp), %rax
cmpb $0x0, 0x94(%rax)
jne 0x1860bb
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
callq 0x1864c0
movl -0xc(%rbp), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x98(%rax)
movq -0x8(%rbp), %rax
movb $0x1, 0x94(%rax)
movq -0x8(%rbp), %rax
movq 0xd0(%rax), %rax
movl -0xc(%rbp), %ecx
imulq $0x6, %rcx, %rcx
addq %rcx, %rax
movb 0x2(%rax), %cl
movq -0x8(%rbp), %rax
movb %cl, 0xa0(%rax)
jmp 0x1861df
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
callq 0x186660
cmpl $0x0, %eax
je 0x18610a
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
callq 0x1864c0
movq -0x8(%rbp), %rax
cmpl $0x0, 0x60(%rax)
je 0x1860e7
jmp 0x1861df
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movl 0x98(%rax), %esi
movq -0x8(%rbp), %rax
movzbl 0xa0(%rax), %edx
callq 0x1866c0
jmp 0x1861d2
movl -0xc(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0xa8(%rcx), %eax
jbe 0x186195
movq -0x8(%rbp), %rax
cmpb $0x0, 0x5a(%rax)
jne 0x186195
movq -0x8(%rbp), %rax
cmpb $0x0, 0x5b(%rax)
jne 0x186195
movq -0x8(%rbp), %rax
cmpb $0x0, 0x30(%rax)
je 0x18616e
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %ecx
movq -0x8(%rbp), %rax
movl 0xa8(%rax), %r8d
movl $0x1, %esi
leaq 0x516c4(%rip), %rdx     # 0x1d7819
movb $0x0, %al
callq 0x1848d0
movq -0x8(%rbp), %rdi
leaq 0x516e6(%rip), %rsi     # 0x1d784d
callq 0x184880
jmp 0x1861df
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %ecx
movq -0x8(%rbp), %rax
movl 0xa8(%rax), %r8d
movl $0x2, %esi
leaq 0x516ce(%rip), %rdx     # 0x1d785a
movb $0x0, %al
callq 0x185b00
jmp 0x1861df
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movl 0x98(%rax), %esi
movq -0x8(%rbp), %rax
movzbl 0xa0(%rax), %edx
callq 0x1866c0
movq -0x8(%rbp), %rax
cmpl $0x0, 0x60(%rax)
je 0x1861bf
jmp 0x1861df
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movl 0x9c(%rax), %esi
callq 0x1864c0
movl -0xc(%rbp), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x98(%rax)
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)