LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/deark-bitmap.c
// Function: de_convert_and_write_image_bilevel2
void de_convert_and_write_image_bilevel2(dbuf *f, i64 fpos,
	i64 width, i64 height, i64 rowspan, unsigned int cvtflags,
	de_finfo *fi, unsigned int createflags)
{
	de_bitmap *img = NULL;
	deark *c = f->c;

	if(!de_good_image_dimensions(c, width, height)) return;
	img = de_bitmap_create2(c, width, rowspan*8, height, 1);
	de_convert_image_bilevel(f, fpos, rowspan, img, cvtflags);
	de_bitmap_write_to_file_finfo(img, fi, createflags | DE_CREATEFLAG_IS_BWIMG);
	de_bitmap_destroy(img);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %r9d, 0x4(%rsp)
movq %r8, %r13
movq %rcx, %rbp
movq %rdx, %r14
movq %rsi, 0x20(%rsp)
movl 0x68(%rsp), %ebx
movq 0x60(%rsp), %r12
movq %rdi, 0x18(%rsp)
movq 0x8(%rdi), %r15
movq %r15, %rdi
movq %rdx, %rsi
movq %rcx, %rdx
callq 0xf1db1
testl %eax, %eax
je 0xf2c3f
movq %r12, 0x10(%rsp)
movl %ebx, (%rsp)
movq %r13, 0x8(%rsp)
leaq (,%r13,8), %rbx
movl $0x40, %esi
movq %r15, %rdi
callq 0xe8b2b
testq %r14, %r14
setle %cl
cmpq %r14, %rbx
cmovleq %r14, %rbx
movq %rax, %r12
movq %r15, (%rax)
movq %rbx, 0x8(%rax)
movq %rbx, 0x18(%rax)
movq %rbp, 0x10(%rax)
movl $0x1, 0x24(%rax)
setle %al
orb %cl, %al
jne 0xf2bf8
movq %r14, 0x18(%r12)
movq 0x18(%rsp), %rdi
movq 0x20(%rsp), %rsi
movq 0x8(%rsp), %rdx
movq %r12, %rcx
movl 0x4(%rsp), %r8d
callq 0xf2a40
movl (%rsp), %ecx
orl $0x8, %ecx
movq %r12, %rdi
xorl %esi, %esi
movq 0x10(%rsp), %rdx
callq 0xf1f1a
movq %r12, %rdi
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xf228d
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/deark-bitmap.c
// Function: de_read_palette_rgb
void de_read_palette_rgb(dbuf *f,
	i64 fpos, i64 num_entries, i64 entryspan,
	de_color *pal, i64 ncolors_in_pal,
	unsigned int flags)
{
	i64 k;

	if(num_entries > ncolors_in_pal) num_entries = ncolors_in_pal;
	for(k=0; k<num_entries; k++) {
		pal[k] = dbuf_getRGB(f, fpos + k*entryspan, flags);
		de_dbg_pal_entry(f->c, k, pal[k]);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r9, %rbx
cmpq %r9, %rdx
cmovlq %rdx, %rbx
testq %rbx, %rbx
jle 0xf2ca2
movq %r8, %r14
movq %rcx, %r15
movq %rsi, %r12
movq %rdi, %r13
xorl %ebp, %ebp
movq %r13, %rdi
movq %r12, %rsi
movl 0x40(%rsp), %edx
callq 0xef42f
movl %eax, (%r14,%rbp,4)
movq 0x8(%r13), %rdi
movq %rbp, %rsi
movl %eax, %edx
callq 0xe91fc
incq %rbp
addq %r15, %r12
cmpq %rbp, %rbx
jne 0xf2c76
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/deark-bitmap.c
// Function: de_convert_image_paletted
void de_convert_image_paletted(dbuf *f, i64 fpos,
	i64 bpp, i64 rowspan, const de_color *pal,
	de_bitmap *img, unsigned int flags)
{
	i64 i, j;
	unsigned int palent;
	u8 mask;

	if(bpp!=1 && bpp!=2 && bpp!=4 && bpp!=8) return;
	if(!de_bitmap_good_dimensions(img, 0)) return;

	mask = (1U<<(UI)bpp)-1;

	for(j=0; j<img->height; j++) {
		i64 pos = fpos + j*rowspan;

		i = 0;

		while(1) {
			UI nbits_avail;
			u8 b = 0;

			b = dbuf_getbyte_p(f, &pos);
			nbits_avail = 8;

			while(nbits_avail >= (UI)bpp) {
				nbits_avail -= (UI)bpp;
				if(flags & 0x1) {
					palent = b & mask;
					b >>= (UI)bpp;
				}
				else {
					palent = (b >> nbits_avail) & mask;
				}
				de_bitmap_setpixel_rgba(img, i++, j, pal[palent]);
				if(i>=img->width) goto nextrow;
			}
		}
	nextrow:
		;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %r8, 0x38(%rsp)
movq %rcx, 0x28(%rsp)
movq %rsi, 0x20(%rsp)
movq %rdi, 0x30(%rsp)
movq %rdx, 0x8(%rsp)
cmpq $0x8, %rdx
ja 0xf30a4
movl $0x116, %eax            # imm = 0x116
movq 0x8(%rsp), %rcx
btq %rcx, %rax
jae 0xf30a4
movq %r9, %rbx
movq %r9, %rdi
xorl %esi, %esi
callq 0xf1dfc
testl %eax, %eax
je 0xf30a4
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movq 0x8(%rsp), %rcx
shll %cl, %eax
cmpq $0x0, 0x10(%rbx)
jle 0xf30a4
notb %al
movl %eax, 0x1c(%rsp)
movzbl %al, %eax
movl %eax, 0x18(%rsp)
movq 0x8(%rsp), %rax
negl %eax
movl %eax, 0x14(%rsp)
xorl %r15d, %r15d
movq %r15, %rax
imulq 0x28(%rsp), %rax
addq 0x20(%rsp), %rax
movq %rax, 0x40(%rsp)
xorl %r12d, %r12d
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rsi
callq 0xeeb4b
movl %eax, %ebp
movl $0x8, %ecx
movl $0x8, %r14d
subl 0x8(%rsp), %r14d
jb 0xf301b
movzbl %bpl, %eax
movl 0x80(%rsp), %edx
testb $0x1, %dl
jne 0xf305c
addl 0x14(%rsp), %ecx
shrl %cl, %eax
andl 0x18(%rsp), %eax
movl %eax, %edx
jmp 0xf306e
movl %eax, %ecx
andb 0x1c(%rsp), %cl
movzbl %cl, %edx
movq 0x8(%rsp), %rcx
shrl %cl, %eax
movl %eax, %ebp
leaq 0x1(%r12), %r13
movl %edx, %eax
movq 0x38(%rsp), %rcx
movl (%rcx,%rax,4), %ecx
movq %rbx, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0xf24bf
movq %r13, %r12
movl %r14d, %ecx
cmpq 0x8(%rbx), %r13
jl 0xf3037
incq %r15
cmpq 0x10(%rbx), %r15
jl 0xf3005
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/deark-bitmap.c
// Function: de_convert_image_rgb
void de_convert_image_rgb(dbuf *f, i64 fpos,
	i64 rowspan, i64 pixelspan, de_bitmap *img, unsigned int flags)
{
	i64 i, j;
	de_color clr;

	for(j=0; j<img->height; j++) {
		for(i=0; i<img->width; i++) {
			clr = dbuf_getRGB(f, fpos + j*rowspan + i*pixelspan, flags);
			de_bitmap_setpixel_rgb(img, i, j, clr);
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, 0x8(%rsp)
movq 0x10(%r8), %rdx
testq %rdx, %rdx
jle 0xf3303
movl %r9d, %r15d
movq %r8, %r14
movq %rcx, %rbp
movq %rsi, %r13
movq %rdi, %r12
movq 0x8(%r8), %rax
xorl %r8d, %r8d
testq %rax, %rax
jle 0xf32f6
movq %r13, 0x10(%rsp)
xorl %ebx, %ebx
movq %r8, (%rsp)
movq %r12, %rdi
movq %r13, %rsi
movl %r15d, %edx
callq 0xef42f
movq %r14, %rdi
movq %rbx, %rsi
movq (%rsp), %rdx
movl %eax, %ecx
callq 0xf24bf
incq %rbx
movq 0x8(%r14), %rax
addq %rbp, %r13
cmpq %rax, %rbx
jl 0xf32bb
movq 0x10(%r14), %rdx
movq 0x10(%rsp), %r13
movq (%rsp), %r8
incq %r8
addq 0x8(%rsp), %r13
cmpq %rdx, %r8
jl 0xf32ab
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/deark-bitmap.c
// Function: de_bitmap_flip
void de_bitmap_flip(de_bitmap *img)
{
	i64 i, j;
	i64 nr;

	nr = img->height/2;

	for(j=0; j<nr; j++) {
		i64 row1, row2;

		row1 = j;
		row2 = img->height-1-j;

		for(i=0; i<img->width; i++) {
			de_color tmp1, tmp2;

			tmp1 = de_bitmap_getpixel(img, i, row1);
			tmp2 = de_bitmap_getpixel(img, i, row2);
			if(tmp1==tmp2) continue;
			de_bitmap_setpixel_rgba(img, i, row2, tmp1);
			de_bitmap_setpixel_rgba(img, i, row1, tmp2);
		}
	}
}

// Assembly:
movq 0x10(%rdi), %rax
cmpq $0x2, %rax
jl 0xf33d5
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movq %rax, %rcx
shrq $0x3f, %rcx
addq %rax, %rcx
sarq %rcx
movq %rcx, 0x10(%rsp)
movq 0x8(%rdi), %rax
movq %rax, 0x8(%rsp)
xorl %r14d, %r14d
cmpq $0x0, 0x8(%rsp)
jle 0xf33bd
movq %r14, %r15
notq %r15
addq 0x10(%rbx), %r15
xorl %r12d, %r12d
movq %rbx, %rdi
movq %r12, %rsi
movq %r14, %rdx
callq 0xf2592
movl %eax, %ebp
movq %rbx, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0xf2592
cmpl %eax, %ebp
je 0xf33b3
movl %eax, %r13d
movq %rbx, %rdi
movq %r12, %rsi
movq %r15, %rdx
movl %ebp, %ecx
callq 0xf24bf
movq %rbx, %rdi
movq %r12, %rsi
movq %r14, %rdx
movl %r13d, %ecx
callq 0xf24bf
movq 0x8(%rbx), %rax
movq %rax, 0x8(%rsp)
incq %r12
cmpq 0x8(%rsp), %r12
jl 0xf3364
incq %r14
cmpq 0x10(%rsp), %r14
jne 0xf334f
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/deark-bitmap.c
// Function: de_bitmap_mirror
void de_bitmap_mirror(de_bitmap *img)
{
	i64 i, j;
	i64 nc;

	de_bitmap_apply_padding(img);
	nc = img->width/2;

	for(j=0; j<img->height; j++) {
		for(i=0; i<nc; i++) {
			i64 col1, col2;
			de_color tmp1, tmp2;

			col1 = i;
			col2 = img->width-1-i;

			tmp1 = de_bitmap_getpixel(img, col1, j);
			tmp2 = de_bitmap_getpixel(img, col2, j);
			if(tmp1==tmp2) continue;
			de_bitmap_setpixel_rgba(img, col2, j, tmp1);
			de_bitmap_setpixel_rgba(img, col1, j, tmp2);
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %r13
movq 0x8(%rdi), %rcx
cmpq %rcx, 0x18(%rdi)
je 0xf33f5
movq %rcx, 0x18(%r13)
movq 0x10(%r13), %rax
testq %rax, %rax
jle 0xf34c8
movq %rcx, %rdx
shrq $0x3f, %rdx
addq %rcx, %rdx
sarq %rdx
movq %rdx, 0x20(%rsp)
movq $0x0, 0x8(%rsp)
movq %r13, 0x10(%rsp)
movq %rcx, 0x18(%rsp)
cmpq $0x2, %rcx
jl 0xf34b2
movq $-0x1, %rbx
xorl %r15d, %r15d
movq 0x8(%r13), %r12
addq %rbx, %r12
movq %r13, %rdi
movq %r15, %rsi
movq 0x8(%rsp), %r14
movq %r14, %rdx
callq 0xf2592
movl %eax, %ebp
movq %r13, %rdi
movq %r12, %rsi
movq %r14, %rdx
callq 0xf2592
cmpl %eax, %ebp
je 0xf3497
movl %eax, %r13d
movq 0x10(%rsp), %r14
movq %r14, %rdi
movq %r12, %rsi
movq 0x8(%rsp), %r12
movq %r12, %rdx
movl %ebp, %ecx
callq 0xf24bf
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
movl %r13d, %ecx
callq 0xf24bf
incq %r15
decq %rbx
cmpq %r15, 0x20(%rsp)
movq 0x10(%rsp), %r13
jne 0xf343b
movq 0x10(%r13), %rax
movq 0x18(%rsp), %rcx
movq 0x8(%rsp), %rsi
incq %rsi
movq %rsi, 0x8(%rsp)
cmpq %rax, %rsi
jl 0xf3427
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/deark-bitmap.c
// Function: de_bitmap_transpose
void de_bitmap_transpose(de_bitmap *img)
{
	i64 i, j;
	de_bitmap *imgtmp = NULL;

	de_bitmap_apply_padding(img);

	if(img->width == img->height) {
		bitmap_transpose_square(img);
		goto done;
	}

	imgtmp = de_bitmap_clone(img);

	de_bitmap_free_pixels(img);
	img->width = imgtmp->height;
	img->unpadded_width = imgtmp->height;
	img->height = imgtmp->width;

	for(j=0; j<img->height; j++) {
		for(i=0; i<img->width; i++) {
			de_color tmp1;

			tmp1 = de_bitmap_getpixel(imgtmp, j, i);
			de_bitmap_setpixel_rgba(img, i, j, tmp1);
		}
	}

done:
	if(imgtmp) de_bitmap_destroy(imgtmp);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
movq 0x8(%rdi), %rax
cmpq %rax, 0x18(%rdi)
je 0xf34f0
movq %rax, 0x18(%rbx)
cmpq 0x10(%rbx), %rax
jne 0xf3569
testq %rax, %rax
jle 0xf3560
xorl %r14d, %r14d
testq %r14, %r14
je 0xf3558
xorl %r15d, %r15d
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0xf2592
movl %eax, %ebp
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0xf2592
cmpl %eax, %ebp
je 0xf354c
movl %eax, %r12d
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
movl %ebp, %ecx
callq 0xf24bf
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
movl %r12d, %ecx
callq 0xf24bf
incq %r15
cmpq %r15, %r14
jne 0xf3506
movq 0x10(%rbx), %rax
incq %r14
cmpq %rax, %r14
jl 0xf34fe
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq (%rbx), %r15
movl $0x40, %esi
movq %r15, %rdi
callq 0xe8b2b
movq %rax, %r14
movq %r15, (%rax)
movups (%rbx), %xmm0
movups 0x10(%rbx), %xmm1
movups 0x20(%rbx), %xmm2
movups 0x30(%rbx), %xmm3
movups %xmm2, 0x20(%rax)
movups %xmm3, 0x30(%rax)
movups %xmm0, (%rax)
movups %xmm1, 0x10(%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x28(%rax)
movq %rax, %rdi
callq 0xf216c
movq 0x30(%r14), %rdi
movq 0x30(%rbx), %rsi
callq 0xe9c3b
movq 0x28(%r14), %rdi
movq 0x28(%rbx), %rsi
movq %rax, %rdx
callq 0x181e0
movq 0x28(%rbx), %rsi
testq %rsi, %rsi
je 0xf35e2
movq (%rbx), %rdi
callq 0xe8be2
movq $0x0, 0x28(%rbx)
movq $0x0, 0x30(%rbx)
movq 0x10(%r14), %rax
movq %rax, 0x8(%rbx)
movq %rax, 0x18(%rbx)
movq 0x8(%r14), %rcx
movq %rcx, 0x10(%rbx)
testq %rcx, %rcx
jle 0xf3644
xorl %r15d, %r15d
testq %rax, %rax
jle 0xf363c
xorl %r12d, %r12d
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0xf2592
movq %rbx, %rdi
movq %r12, %rsi
movq %r15, %rdx
movl %eax, %ecx
callq 0xf24bf
incq %r12
movq 0x8(%rbx), %rax
cmpq %rax, %r12
jl 0xf360e
movq 0x10(%rbx), %rcx
incq %r15
cmpq %rcx, %r15
jl 0xf3606
movq %r14, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0xf228d
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/deark-bitmap.c
// Function: de_bitmap_rect
void de_bitmap_rect(de_bitmap *img,
	i64 xpos, i64 ypos, i64 width, i64 height,
	de_color clr, unsigned int flags)
{
	i64 i, j;

	for(j=0; j<height; j++) {
		for(i=0; i<width; i++) {
			de_bitmap_setpixel_rgba(img, xpos+i, ypos+j, clr);
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rcx, 0x8(%rsp)
movq %rdx, 0x18(%rsp)
movq %rsi, 0x10(%rsp)
movq %r8, 0x20(%rsp)
testq %r8, %r8
jle 0xf36c1
movl %r9d, %ebx
movq %rdi, %rbp
xorl %r14d, %r14d
cmpq $0x0, 0x8(%rsp)
jle 0xf36b7
movq 0x18(%rsp), %rax
leaq (%r14,%rax), %r12
movq 0x10(%rsp), %r13
movq 0x8(%rsp), %r15
movq %rbp, %rdi
movq %r13, %rsi
movq %r12, %rdx
movl %ebx, %ecx
callq 0xf24bf
incq %r13
decq %r15
jne 0xf369f
incq %r14
cmpq 0x20(%rsp), %r14
jne 0xf3684
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/deark-bitmap.c
// Function: de_bitmap_copy_rect
void de_bitmap_copy_rect(de_bitmap *srcimg, de_bitmap *dstimg,
	i64 srcxpos, i64 srcypos, i64 width, i64 height,
	i64 dstxpos, i64 dstypos, unsigned int flags)
{
	i64 i, j;
	de_color dst_clr, src_clr, clr;
	de_colorsample src_a;

	for(j=0; j<height; j++) {
		for(i=0; i<width; i++) {
			src_clr = de_bitmap_getpixel(srcimg, srcxpos+i, srcypos+j);
			if(!(flags&DE_BITMAPFLAG_MERGE)) {
				clr = src_clr;
			}
			else {
				src_a = DE_COLOR_A(src_clr);
				if(src_a>0) {
					// TODO: Support partial transparency (of both foreground and
					// background, ideally)
					clr = src_clr;
				}
				else {
					dst_clr = de_bitmap_getpixel(dstimg, dstxpos+i, dstypos+j);
					clr = dst_clr;
				}
			}
			de_bitmap_setpixel_rgba(dstimg, dstxpos+i, dstypos+j, clr);
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %r8, 0x8(%rsp)
movq %rcx, 0x18(%rsp)
movq %rdx, 0x10(%rsp)
movq %rdi, 0x28(%rsp)
movq %r9, 0x20(%rsp)
testq %r9, %r9
jle 0xf37ae
movq %rsi, %r13
movq $0x0, (%rsp)
cmpq $0x0, 0x8(%rsp)
jle 0xf3798
movq 0x18(%rsp), %rax
movq (%rsp), %rcx
addq %rcx, %rax
movq %rax, 0x30(%rsp)
movq 0x78(%rsp), %rax
leaq (%rcx,%rax), %r12
movq 0x10(%rsp), %rbx
movq 0x70(%rsp), %r14
movq 0x8(%rsp), %rbp
movl 0x80(%rsp), %eax
movl %eax, %r15d
shrb %r15b
movq 0x28(%rsp), %rdi
movq %rbx, %rsi
movq 0x30(%rsp), %rdx
callq 0xf2592
cmpl $0x1000000, %eax        # imm = 0x1000000
setb %cl
andb %r15b, %cl
cmpb $0x1, %cl
jne 0xf377d
movq %r13, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0xf2592
movq %r13, %rdi
movq %r14, %rsi
movq %r12, %rdx
movl %eax, %ecx
callq 0xf24bf
incq %r14
incq %rbx
decq %rbp
jne 0xf3740
movq (%rsp), %rcx
incq %rcx
movq %rcx, (%rsp)
cmpq 0x20(%rsp), %rcx
jne 0xf370b
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/deark-bitmap.c
// Function: de_bitmap_apply_mask
void de_bitmap_apply_mask(de_bitmap *fg, de_bitmap *mask,
	unsigned int flags)
{
	i64 i, j;
	de_color clr;
	de_colorsample a;

	for(j=0; j<fg->height && j<mask->height; j++) {
		for(i=0; i<fg->width && i<mask->width; i++) {
			clr = de_bitmap_getpixel(mask, i, j);
			a = DE_COLOR_K(clr);
			if(flags&DE_BITMAPFLAG_WHITEISTRNS)
				a = 0xff-a;
			de_bitmap_setsample(fg, i, j, 3, a);
		}
	}
}

// Assembly:
movq 0x10(%rdi), %rax
testq %rax, %rax
jle 0xf383d
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %r15
andb $0x1, %bl
negb %bl
xorl %r12d, %r12d
cmpq 0x10(%r14), %r12
jge 0xf3834
cmpq $0x0, 0x8(%r15)
jle 0xf382c
xorl %r13d, %r13d
cmpq 0x8(%r14), %r13
jge 0xf3828
movq %r14, %rdi
movq %r13, %rsi
movq %r12, %rdx
callq 0xf2592
shrl $0x10, %eax
xorb %bl, %al
movzbl %al, %r8d
movl $0x3, %ecx
movq %r15, %rdi
movq %r13, %rsi
movq %r12, %rdx
callq 0xf2355
incq %r13
cmpq 0x8(%r15), %r13
jl 0xf37ef
movq 0x10(%r15), %rax
incq %r12
cmpq %rax, %r12
jl 0xf37df
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/deark-bitmap.c
// Function: de_bitmap_remove_alpha
void de_bitmap_remove_alpha(de_bitmap *img)
{
	i64 i, j;
	i64 k;

	if(img->bytes_per_pixel!=2 && img->bytes_per_pixel!=4) return;

	// Note that the format conversion is done in-place. The extra memory used
	// by the alpha channel is not de-allocated.
	for(j=0; j<img->height; j++) {
		for(i=0; i<img->width; i++) {
			for(k=0; k<(i64)img->bytes_per_pixel-1; k++) {
				img->bitmap[(j*img->width+i)*((i64)img->bytes_per_pixel-1) + k] =
					img->bitmap[(j*img->width+i)*(img->bytes_per_pixel) + k];
			}
		}
	}

	img->bytes_per_pixel--;
}

// Assembly:
movl 0x24(%rdi), %ecx
cmpl $0x4, %ecx
je 0xf384b
cmpl $0x2, %ecx
jne 0xf38c3
movq 0x10(%rdi), %rsi
testq %rsi, %rsi
jle 0xf38be
movq 0x8(%rdi), %rdx
xorl %eax, %eax
testq %rdx, %rdx
jle 0xf38b6
xorl %esi, %esi
cmpl $0x2, %ecx
jl 0xf38aa
movl %ecx, %r8d
leaq -0x1(%r8), %r9
xorl %edx, %edx
movq 0x28(%rdi), %rcx
movq 0x8(%rdi), %r10
imulq %rax, %r10
addq %rsi, %r10
imulq %r10, %r8
addq %rcx, %r8
movb (%rdx,%r8), %r8b
imulq %r9, %r10
addq %rcx, %r10
movb %r8b, (%rdx,%r10)
incq %rdx
movl 0x24(%rdi), %ecx
movslq %ecx, %r8
leaq -0x1(%r8), %r9
cmpq %r9, %rdx
jl 0xf386f
movq 0x8(%rdi), %rdx
incq %rsi
cmpq %rdx, %rsi
jl 0xf3861
movq 0x10(%rdi), %rsi
incq %rax
cmpq %rsi, %rax
jl 0xf385a
decl %ecx
movl %ecx, 0x24(%rdi)
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/deark-bitmap.c
// Function: de_bitmap_optimize_alpha
void de_bitmap_optimize_alpha(de_bitmap *img, unsigned int flags)
{
	struct image_scan_opt_data optctx;

	if(img->bytes_per_pixel!=2 && img->bytes_per_pixel!=4) return;

	de_zeromem(&optctx, sizeof(struct image_scan_opt_data));
	scan_image(img, &optctx);

	if((flags&0x4) && !optctx.has_visible_pixels &&
		(optctx.has_only_invis_black_pixels || optctx.has_only_invis_white_pixels))
	{
		// No visible pixels, but the image is boring enough that it may be by
		// design, so don't remove the alpha channel.
		return;
	}

	if(optctx.has_trns && !optctx.has_visible_pixels && (flags&(0x1|0x4))) {
		if(flags&0x2) {
			de_warn(img->c, "Invisible image detected. Ignoring transparency.");
		}
	}
	else if(optctx.has_trns) {
		return;
	}

	// No meaningful transparency found.
	de_dbg3(img->c, "Removing alpha channel from image");

	de_bitmap_remove_alpha(img);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movl %esi, %ebp
movq %rdi, %rbx
movl 0x24(%rdi), %eax
cmpl $0x4, %eax
je 0xf38de
cmpl $0x2, %eax
jne 0xf3940
xorps %xmm0, %xmm0
movq %rsp, %r14
movaps %xmm0, (%r14)
movq %rbx, %rdi
movq %r14, %rsi
callq 0xf396a
testb $0x4, %bpl
sete %cl
movb 0x2(%r14), %al
testb %al, %al
setne %dl
orb %cl, %dl
jne 0xf3911
movb 0x5(%rsp), %cl
orb 0x4(%rsp), %cl
jne 0xf3940
movb 0x1(%rsp), %cl
testb $0x5, %bpl
je 0xf393c
testb %cl, %cl
je 0xf393c
testb %al, %al
jne 0xf393c
testb $0x2, %bpl
je 0xf3949
movq (%rbx), %rdi
leaq 0x55d1b(%rip), %rsi     # 0x14964e
xorl %eax, %eax
callq 0xe8faa
jmp 0xf3949
testb %cl, %cl
je 0xf3949
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movq (%rbx), %rdi
leaq 0x55d2c(%rip), %rsi     # 0x14967f
xorl %eax, %eax
callq 0xe889f
movq %rbx, %rdi
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
jmp 0xf383e
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/deark-bitmap.c
// Function: de_make_grayscale_palette
void de_make_grayscale_palette(de_color *pal, i64 num_entries, unsigned int flags)
{
	i64 k;
	u8 b;

	for(k=0; k<num_entries; k++) {
		b = (u8)(0.5+ (double)k * (255.0 / (double)(num_entries-1)));
		if(flags&0x1) b = 255-b;
		pal[k] = DE_MAKE_GRAY(b);
	}
}

// Assembly:
testq %rsi, %rsi
jle 0xf3d45
andb $0x1, %dl
negb %dl
leaq -0x1(%rsi), %rax
cvtsi2sd %rax, %xmm1
movsd 0x23c3e(%rip), %xmm0    # 0x117838
divsd %xmm1, %xmm0
incq %rsi
andq $-0x2, %rsi
movq %rax, %xmm1
pshufd $0x44, %xmm1, %xmm1     # xmm1 = xmm1[0,1,0,1]
unpcklpd %xmm0, %xmm0            # xmm0 = xmm0[0,0]
movdqa 0x3cab5(%rip), %xmm2    # 0x1306d0
xorl %eax, %eax
movdqa 0x3cabb(%rip), %xmm3    # 0x1306e0
pxor %xmm3, %xmm1
movdqa 0x23b3f(%rip), %xmm4    # 0x117770
movdqa 0x23b47(%rip), %xmm5    # 0x117780
movdqa 0x23b4f(%rip), %xmm6    # 0x117790
movapd 0x23b57(%rip), %xmm7    # 0x1177a0
movapd 0x35cae(%rip), %xmm8    # 0x129900
pcmpeqd %xmm9, %xmm9
movdqa 0x3caa0(%rip), %xmm10   # 0x130700
movdqa %xmm2, %xmm11
pxor %xmm3, %xmm11
movdqa %xmm11, %xmm12
pcmpgtd %xmm1, %xmm12
pcmpeqd %xmm1, %xmm11
pshufd $0xf5, %xmm11, %xmm11   # xmm11 = xmm11[1,1,3,3]
pand %xmm12, %xmm11
pshufd $0xf5, %xmm12, %xmm12   # xmm12 = xmm12[1,1,3,3]
por %xmm11, %xmm12
leaq 0x1(%rax), %rcx
movq %rax, %xmm11
movq %rcx, %xmm13
punpcklqdq %xmm13, %xmm11  # xmm11 = xmm11[0],xmm13[0]
movdqa %xmm11, %xmm13
pand %xmm4, %xmm13
por %xmm5, %xmm13
psrlq $0x20, %xmm11
por %xmm6, %xmm11
subpd %xmm7, %xmm11
addpd %xmm13, %xmm11
mulpd %xmm0, %xmm11
addpd %xmm8, %xmm11
movd %xmm12, %r8d
notl %r8d
testb $0x1, %r8b
je 0xf3cfc
cvttsd2si %xmm11, %r8d
xorb %dl, %r8b
movzbl %r8b, %r8d
imull $0x10101, %r8d, %r8d    # imm = 0x10101
orl $0xff000000, %r8d       # imm = 0xFF000000
movl %r8d, (%rdi,%rax,4)
pxor %xmm9, %xmm12
pextrw $0x4, %xmm12, %r8d
testb $0x1, %r8b
je 0xf3d31
unpckhpd %xmm11, %xmm11          # xmm11 = xmm11[1,1]
cvttsd2si %xmm11, %r8d
xorb %dl, %r8b
movzbl %r8b, %r8d
imull $0x10101, %r8d, %r8d    # imm = 0x10101
orl $0xff000000, %r8d       # imm = 0xFF000000
movl %r8d, 0x4(%rdi,%rax,4)
paddq %xmm10, %xmm2
incq %rcx
movq %rcx, %rax
cmpq %rsi, %rcx
jne 0xf3c60
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/deark-bitmap.c
// Function: de_unpremultiply_alpha_samp
de_colorsample de_unpremultiply_alpha_samp(de_colorsample cval, de_colorsample a)
{
	if(a==0xff) {
		return cval;
	}
	if(a==0 || cval==0) {
		return 0;
	}
	if(cval>=a) {
		return 0xff;
	}
	return (de_colorsample)(0.5 + (double)cval / ((double)a/255.0));
}

// Assembly:
cmpl $0xff, %esi
je 0xf3d61
testb %sil, %sil
sete %al
testb %dil, %dil
sete %cl
orb %al, %cl
je 0xf3d64
xorl %eax, %eax
retq
movl %edi, %eax
retq
movb $-0x1, %al
cmpb %sil, %dil
jae 0xf3d60
movzbl %dil, %eax
cvtsi2sd %eax, %xmm0
movzbl %sil, %eax
cvtsi2sd %eax, %xmm1
divsd 0x23ab5(%rip), %xmm1    # 0x117838
divsd %xmm1, %xmm0
addsd 0x23aa1(%rip), %xmm0    # 0x117830
cvttsd2si %xmm0, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/deark-bitmap.c
// Function: de_unpremultiply_alpha_clr
de_color de_unpremultiply_alpha_clr(de_color clr)
{
	de_colorsample r, g, b, a;

	r = DE_COLOR_R(clr);
	g = DE_COLOR_G(clr);
	b = DE_COLOR_B(clr);
	a = DE_COLOR_A(clr);
	r = de_unpremultiply_alpha_samp(r, a);
	g = de_unpremultiply_alpha_samp(g, a);
	b = de_unpremultiply_alpha_samp(b, a);
	return DE_MAKE_RGBA(r, g, b, a);
}

// Assembly:
movl %edi, %r8d
shrl $0x10, %r8d
movl %edi, %esi
shrl $0x8, %esi
movl %edi, %ecx
shrl $0x18, %ecx
cmpl $0xff, %ecx
jne 0xf3db9
movl %esi, %edx
movl %r8d, %eax
movl %edi, %esi
jmp 0xf3e9a
cmpl $0x1000000, %edi        # imm = 0x1000000
setb %al
testb %r8b, %r8b
sete %dl
orb %al, %dl
je 0xf3dd0
xorl %eax, %eax
jmp 0xf3dfe
movb $-0x1, %al
cmpb %cl, %r8b
jae 0xf3dfe
movzbl %r8b, %eax
cvtsi2sd %eax, %xmm0
movzbl %cl, %eax
cvtsi2sd %eax, %xmm1
divsd 0x23a4a(%rip), %xmm1    # 0x117838
divsd %xmm1, %xmm0
addsd 0x23a36(%rip), %xmm0    # 0x117830
cvttsd2si %xmm0, %eax
cmpl $0x1000000, %edi        # imm = 0x1000000
setb %dl
testb %sil, %sil
sete %r8b
orb %dl, %r8b
je 0xf3e17
xorl %edx, %edx
jmp 0xf3e4b
movb $-0x1, %dl
cmpb %cl, %sil
jae 0xf3e4b
movzbl %sil, %edx
xorps %xmm0, %xmm0
cvtsi2sd %edx, %xmm0
movzbl %cl, %edx
xorps %xmm1, %xmm1
cvtsi2sd %edx, %xmm1
divsd 0x239fd(%rip), %xmm1    # 0x117838
divsd %xmm1, %xmm0
addsd 0x239e9(%rip), %xmm0    # 0x117830
cvttsd2si %xmm0, %edx
cmpl $0x1000000, %edi        # imm = 0x1000000
setb %sil
testb %dil, %dil
sete %r8b
orb %sil, %r8b
je 0xf3e65
xorl %esi, %esi
jmp 0xf3e9a
movb $-0x1, %sil
cmpb %cl, %dil
jae 0xf3e9a
movzbl %dil, %esi
xorps %xmm0, %xmm0
cvtsi2sd %esi, %xmm0
movzbl %cl, %ecx
xorps %xmm1, %xmm1
cvtsi2sd %ecx, %xmm1
divsd 0x239ae(%rip), %xmm1    # 0x117838
divsd %xmm1, %xmm0
addsd 0x2399a(%rip), %xmm0    # 0x117830
cvttsd2si %xmm0, %esi
andl $0xff000000, %edi       # imm = 0xFF000000
movzbl %al, %eax
shll $0x10, %eax
orl %edi, %eax
movzbl %dl, %ecx
shll $0x8, %ecx
orl %eax, %ecx
movzbl %sil, %eax
orl %ecx, %eax
retq
nop
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/deark-char.c
// Function: de_free_charctx_screens
void de_free_charctx_screens(deark *c, struct de_char_context *charctx)
{
	i64 pgnum;
	i64 j;

	if(!charctx || !charctx->screens) return;

	for(pgnum=0; pgnum<charctx->nscreens; pgnum++) {
		if(charctx->screens[pgnum]) {
			if(charctx->screens[pgnum]->cell_rows) {
				for(j=0; j<charctx->screens[pgnum]->height; j++) {
					de_free(c, charctx->screens[pgnum]->cell_rows[j]);
				}
				de_free(c, charctx->screens[pgnum]->cell_rows);
			}
			de_free(c, charctx->screens[pgnum]);
		}
	}
	de_free(c, charctx->screens);
	charctx->screens = NULL;
}

// Assembly:
testq %rsi, %rsi
je 0xf3f7d
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq 0x18(%rsi), %rsi
testq %rsi, %rsi
je 0xf3f72
movq %rdi, %r14
movq 0x10(%rbx), %rax
testq %rax, %rax
jle 0xf3f62
xorl %r15d, %r15d
movq 0x18(%rbx), %rcx
movq (%rcx,%r15,8), %rsi
testq %rsi, %rsi
je 0xf3f56
movq 0x10(%rsi), %rax
testq %rax, %rax
je 0xf3f4a
cmpq $0x0, 0x8(%rsi)
jle 0xf3f37
xorl %r12d, %r12d
movq 0x10(%rsi), %rax
movq (%rax,%r12,8), %rsi
movq %r14, %rdi
callq 0xe8be2
incq %r12
movq 0x18(%rbx), %rax
movq (%rax,%r15,8), %rsi
cmpq 0x8(%rsi), %r12
jl 0xf3f12
movq 0x10(%rsi), %rax
movq %r14, %rdi
movq %rax, %rsi
callq 0xe8be2
movq 0x18(%rbx), %rax
movq (%rax,%r15,8), %rsi
movq %r14, %rdi
callq 0xe8be2
movq 0x10(%rbx), %rax
incq %r15
cmpq %rax, %r15
jl 0xf3ef2
movq 0x18(%rbx), %rsi
movq %r14, %rdi
callq 0xe8be2
movq $0x0, 0x18(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/deark-char.c
// Function: de_destroy_charctx
void de_destroy_charctx(deark *c, struct de_char_context *charctx)
{
	if(!charctx) return;

	if(charctx->screens) {
		de_internal_err_fatal(c, "charctx");
	}
	de_free(c, charctx);
}

// Assembly:
testq %rsi, %rsi
je 0xf3fb7
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
cmpq $0x0, 0x18(%rsi)
je 0xf3fa5
leaq 0x5571d(%rip), %rsi     # 0x1496b8
movq %r14, %rdi
xorl %eax, %eax
callq 0xe9544
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xe8be2
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/deark-char.c
// Function: de_char_decide_output_format
void de_char_decide_output_format(deark *c, struct de_char_context *charctx)
{
	const char *s;

	if(charctx->outfmt_known) return;
	charctx->outfmt_known = 1;

	if(charctx->prefer_image_output)
		charctx->outfmt = 1;

	s = de_get_ext_option(c, "char:output");
	if(s) {
		if(!de_strcmp(s, "html")) {
			charctx->outfmt = 0;
		}
		else if(!de_strcmp(s, "image")) {
			charctx->outfmt = 1;
		}
	}
}

// Assembly:
cmpb $0x0, 0x5(%rsi)
je 0xf3fe6
retq
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movb $0x1, 0x5(%rsi)
cmpb $0x0, (%rsi)
je 0xf3ffd
movl $0x1, 0x8(%rbx)
leaq 0x556bc(%rip), %rsi     # 0x1496c0
callq 0xe9b74
testq %rax, %rax
je 0xf4043
movq %rax, %r14
leaq 0x4c49a(%rip), %rsi     # 0x1404b2
movq %rax, %rdi
callq 0x181a0
testl %eax, %eax
je 0xf403e
leaq 0x30fc9(%rip), %rsi     # 0x124ff4
movq %r14, %rdi
callq 0x181a0
testl %eax, %eax
jne 0xf4043
movl $0x1, %eax
jmp 0xf4040
xorl %eax, %eax
movl %eax, 0x8(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/deark-char.c
// Function: do_render_character
static void do_render_character(deark *c, struct de_char_context *charctx,
	struct charextractx *ectx, de_bitmap *img,
	i64 xpos, i64 ypos,
	i32 codepoint, int codepoint_is_unicode,
	u32 fgcol, u32 bgcol,
	unsigned int extra_flags)
{
	i64 xpos_in_pix, ypos_in_pix;
	u32 fgcol_rgb, bgcol_rgb;
	unsigned int flags;

	xpos_in_pix = xpos * ectx->char_width_in_pixels;
	ypos_in_pix = ypos * ectx->char_height_in_pixels;

	if(DE_IS_PAL_COLOR(fgcol))
		fgcol_rgb = charctx->pal[fgcol];
	else
		fgcol_rgb = fgcol;
	if(DE_IS_PAL_COLOR(bgcol))
		bgcol_rgb = charctx->pal[bgcol];
	else
		bgcol_rgb = bgcol;

	flags = extra_flags;
	if(ectx->vga_9col_mode) flags |= DE_PAINTFLAG_VGA9COL;

	if(codepoint_is_unicode) {
		de_font_paint_character_cp(c, img, ectx->font_to_use, codepoint,
			xpos_in_pix, ypos_in_pix, fgcol_rgb, bgcol_rgb, flags);
	}
	else {
		de_font_paint_character_idx(c, img, ectx->font_to_use, (i64)codepoint,
			xpos_in_pix, ypos_in_pix, fgcol_rgb, bgcol_rgb, flags);
	}
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl 0x38(%rsp), %r11d
movl 0x30(%rsp), %r10d
cmpl $0xf, %r10d
ja 0xf4e6b
movl %r10d, %eax
movl 0x20(%rsi,%rax,4), %r10d
movl 0x40(%rsp), %r14d
movl 0x28(%rsp), %ebp
cmpl $0xf, %r11d
ja 0xf4e82
movl %r11d, %eax
movl 0x20(%rsi,%rax,4), %r11d
movl 0x20(%rsp), %eax
imulq 0x38(%rdx), %r8
imulq 0x40(%rdx), %r9
movl %r14d, %ebx
orl $0x2, %ebx
cmpb $0x0, (%rdx)
cmovel %r14d, %ebx
movq 0x30(%rdx), %rdx
testl %ebp, %ebp
je 0xf4eba
subq $0x8, %rsp
movq %rcx, %rsi
movl %eax, %ecx
pushq %rbx
pushq %r11
pushq %r10
callq 0xf5689
jmp 0xf4ed0
cltq
subq $0x8, %rsp
movq %rcx, %rsi
movq %rax, %rcx
pushq %rbx
pushq %r11
pushq %r10
callq 0xf5372
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/deark-char.c
// Function: write_ucstring_to_html
static void write_ucstring_to_html(deark *c, const de_ucstring *s, dbuf *f)
{
	i64 i;
	i64 f_len;
	i64 len_at_last_linebreak;
	int prev_space = 0;
	i32 ch;

	if(!s) return;

	f_len = dbuf_get_length(f);
	len_at_last_linebreak = f_len;

	for(i=0; i<s->len; i++) {
		ch = s->str[i];

		// Don't let HTML collapse consecutive spaces
		// (this is not ideal, but it's better than nothing).
		if(ch==0x20) {
			if(prev_space) {
				ch = 0xa0; // nbsp
			}
			prev_space = 1;
		}
		else {
			prev_space = 0;
		}

		if(ch==0x0a) {
			dbuf_puts(f, "<br>\n");
			f_len = dbuf_get_length(f);
			len_at_last_linebreak = f_len;
		}
		else if(ch==0x20 && (f_len - len_at_last_linebreak > 70)) { // zzz
			// Low-quality attempt at word wrapping
			dbuf_puts(f, "\n");
			f_len = dbuf_get_length(f);
			len_at_last_linebreak = f_len;
		}
		else {
			de_write_codepoint_to_html(c, f, ch);
			f_len = dbuf_get_length(f);
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, (%rsp)
testq %rsi, %rsi
je 0xf4f91
movq %rdx, %rbx
movq %rsi, %r14
movq %rdx, %rdi
callq 0xf1701
cmpq $0x0, 0x10(%r14)
jle 0xf4f91
movq %rax, %rbp
xorl %r13d, %r13d
xorl %r12d, %r12d
movq 0x8(%r14), %rcx
movl (%rcx,%r12,4), %ecx
xorl %edx, %edx
testl %r13d, %r13d
setne %dl
shll $0x7, %edx
orl $0x20, %edx
xorl %r13d, %r13d
cmpl $0x20, %ecx
sete %r15b
cmovnel %ecx, %edx
cmpl $0x20, %edx
je 0xf4f4c
cmpl $0xa, %edx
jne 0xf4f71
movq %rbx, %rdi
leaq 0x4ccd6(%rip), %rsi     # 0x141c20
jmp 0xf4f5f
subq %rbp, %rax
cmpq $0x47, %rax
jl 0xf4f71
movq %rbx, %rdi
leaq 0x1b228(%rip), %rsi     # 0x110187
callq 0xf10ed
movq %rbx, %rdi
callq 0xf1701
movq %rax, %rbp
jmp 0xf4f85
movq (%rsp), %rdi
movq %rbx, %rsi
callq 0xeca70
movq %rbx, %rdi
callq 0xf1701
movb %r15b, %r13b
incq %r12
cmpq 0x10(%r14), %r12
jl 0xf4f13
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/deark-char.c
// Function: output_css_color_block
static void output_css_color_block(deark *c, dbuf *ofile, u32 *pal,
	const char *selectorprefix, const char *prop, const u8 *used_flags)
{
	char tmpbuf[16];
	int i;

	for(i=0; i<16; i++) {
		if(!used_flags[i]) continue;
		de_color_to_css(pal[i], tmpbuf, sizeof(tmpbuf));
		dbuf_printf(ofile, " %s%c { %s: %s }\n", selectorprefix, de_get_hexchar(i),
			prop, tmpbuf);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %r8, %rbx
movq %rcx, 0x8(%rsp)
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %r13
leaq 0x10(%rsp), %rbp
xorl %r14d, %r14d
cmpb $0x0, (%rbx,%r14)
je 0xf5006
movl (%r12,%r14,4), %edi
movq %rbp, %rsi
movl $0x10, %edx
callq 0xec648
movl %r14d, %edi
callq 0xebba8
movsbl %al, %ecx
movq %r13, %rdi
leaq 0x54bc4(%rip), %rsi     # 0x149bb8
movq %r15, %rdx
movq 0x8(%rsp), %r8
movq %rbp, %r9
xorl %eax, %eax
callq 0xf08da
incq %r14
cmpq $0x10, %r14
jne 0xf4fc7
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/deark-char.c
// Function: print_header_item
static void print_header_item(deark *c, dbuf *ofile, const char *name_rawhtml, const de_ucstring *value)
{
	int k;

	dbuf_puts(ofile, "<td class=htc>");
	if(ucstring_isnonempty(value)) {
		dbuf_printf(ofile, "<span class=hn>%s:&nbsp; </span><span class=hv>", name_rawhtml);
		write_ucstring_to_html(c, value, ofile);
		dbuf_puts(ofile, "</span>");
	}
	else {
		// Placeholder
		for(k=0; k<20; k++) {
			de_write_codepoint_to_html(c, ofile, 0x00a0); // nbsp
		}
	}
	dbuf_puts(ofile, "</td>\n");
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rcx, %r15
movq %rdx, %r12
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x54b91(%rip), %rsi     # 0x149bca
movq %rbx, %rdi
callq 0xf10ed
movq %r15, %rdi
callq 0xf67a3
testl %eax, %eax
je 0xf5080
leaq 0x54b85(%rip), %rsi     # 0x149bd9
movq %rbx, %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0xf08da
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0xf4ed9
leaq 0x54bc2(%rip), %rsi     # 0x149c38
movq %rbx, %rdi
callq 0xf10ed
jmp 0xf5099
movl $0x14, %ebp
movq %r14, %rdi
movq %rbx, %rsi
movl $0xa0, %edx
callq 0xeca70
decl %ebp
jne 0xf5085
leaq 0x54b69(%rip), %rsi     # 0x149c09
movq %rbx, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0xf10ed
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/deark-font.c
// Function: is_valid_char
static int is_valid_char(struct de_bitmap_font_char *ch)
{
	if(!ch) return 0;
	if(!ch->bitmap) return 0;
	if(ch->width<0 || ch->height<0) return 0;
	if(ch->extraspace_l<0 || ch->extraspace_r<0) return 0;
	if(ch->width==0 && (ch->extraspace_l>0 || ch->extraspace_r>0)) {
		// Allow 0-width character if extraspace makes that sensible.
		;
	}
	else if(ch->width<1 || ch->height<1) {
		return 0;
	}
	return 1;
}

// Assembly:
xorl %eax, %eax
testq %rdi, %rdi
je 0xf552d
cmpq $0x0, 0x20(%rdi)
je 0xf552d
movl 0x8(%rdi), %ecx
testl %ecx, %ecx
js 0xf552d
movl 0xc(%rdi), %edx
testl %edx, %edx
js 0xf552d
movzwl 0x14(%rdi), %esi
testw %si, %si
js 0xf552d
movzwl 0x16(%rdi), %edi
testw %di, %di
js 0xf552d
testl %ecx, %ecx
je 0xf552e
testl %edx, %edx
je 0xf552d
movl $0x1, %eax
retq
orw %si, %di
jne 0xf5528
jmp 0xf552d
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/deark-font.c
// Function: paint_character_internal
static void paint_character_internal(deark *c, de_bitmap *img,
	struct de_bitmap_font_char *ch,
	i64 xpos, i64 ypos, u32 fgcol, unsigned int flags)
{
	i64 i, j;
	i64 num_x_pixels_to_paint;
	int vga9col_flag = 0;

	num_x_pixels_to_paint = (i64)ch->width;
	if((flags&DE_PAINTFLAG_VGA9COL) && ch->width==8) {
		vga9col_flag = 1;
		num_x_pixels_to_paint = 9;
	}

	for(j=0; j<ch->height; j++) {
		i64 j_src;

		j_src = j;
		if(flags&DE_PAINTFLAG_TOPHALF) {
			j_src = j/2;
		}
		else if(flags&DE_PAINTFLAG_BOTTOMHALF) {
			j_src = (ch->height+j)/2;
		}

		for(i=0; i<num_x_pixels_to_paint; i++) {
			i64 i_src; // -1 = No source position
			int is_fg = 0;
			u8 x;

			i_src = i;
			if(flags&DE_PAINTFLAG_LEFTHALF) {
				i_src = i/2;
			}
			else if(flags&DE_PAINTFLAG_RIGHTHALF) {
				i_src = (num_x_pixels_to_paint+i)/2;
			}

			if(i_src==8 && vga9col_flag) {
				// Manufacture a column 8.
				if(ch->codepoint_nonunicode>=0xb0 && ch->codepoint_nonunicode<=0xdf) {
					i_src = 7; // Make this pixel a duplicate of the one in col #7.
				}
				else {
					i_src = -1; // Make this pixel a background pixel.
				}
			}

			if(i_src>=0 && i_src<ch->width) {
				x = ch->bitmap[j_src*ch->rowspan + i_src/8];
				if(x & (1<<(7-i_src%8))) {
					is_fg = 1;
				}
			}

			if(is_fg) {
				u32 clr = fgcol;

				de_bitmap_setpixel_rgba(img, xpos+i, ypos+j, clr);
			}
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl %r9d, %ebx
movl %r8d, 0xc(%rsp)
movq %rcx, 0x10(%rsp)
movq %rdx, 0x28(%rsp)
movq %rdi, 0x20(%rsp)
movl 0x8(%rsi), %eax
cltq
movl %ebx, %ecx
shrb %cl
cmpl $0x8, %eax
sete %bpl
andb %cl, %bpl
movl $0x9, %r15d
cmoveq %rax, %r15
movslq 0xc(%rsi), %rcx
testq %rcx, %rcx
jle 0xf567a
movq %rsi, %r12
xorl %edx, %edx
xorb $0x1, %bpl
movl $0xffffff50, %esi       # imm = 0xFFFFFF50
movl %ecx, %eax
movq %rdx, %r13
testb $0x10, %bl
jne 0xf55b3
testb $0x20, %bl
je 0xf55b6
addq %rdx, %rcx
movq %rcx, %r13
shrq $0x3f, %r13
addq %rcx, %r13
sarq %r13
jmp 0xf55b6
shrq %r13
testq %r15, %r15
jle 0xf566b
movq 0x10(%rsp), %rax
movq %rdx, 0x18(%rsp)
addq %rdx, %rax
movq %rax, 0x30(%rsp)
xorl %r14d, %r14d
movq %r14, %rax
testb $0x4, %bl
jne 0xf55e5
testb $0x8, %bl
je 0xf55e8
leaq (%r15,%r14), %rax
shrq %rax
cmpq $0x8, %rax
setne %cl
orb %bpl, %cl
jne 0xf5604
movl (%r12), %ecx
addl %esi, %ecx
movl $0x7, %eax
cmpl $0x2f, %ecx
ja 0xf5655
movslq 0x8(%r12), %rcx
cmpq %rcx, %rax
jge 0xf5655
movq 0x18(%r12), %rcx
imulq %r13, %rcx
movq %rax, %rdx
shrq $0x3, %rdx
addq 0x20(%r12), %rcx
movzbl (%rdx,%rcx), %ecx
notb %al
movzbl %al, %eax
andl $0x7, %eax
btl %eax, %ecx
jae 0xf5655
movq 0x28(%rsp), %rax
leaq (%rax,%r14), %rsi
movq 0x20(%rsp), %rdi
movq 0x30(%rsp), %rdx
movl 0xc(%rsp), %ecx
callq 0xf24bf
movl $0xffffff50, %esi       # imm = 0xFFFFFF50
incq %r14
cmpq %r14, %r15
jne 0xf55d4
movl 0xc(%r12), %eax
movq 0x18(%rsp), %rdx
incq %rdx
movslq %eax, %rcx
cmpq %rcx, %rdx
jl 0xf5594
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/deark-font.c
// Function: de_font_paint_character_cp
void de_font_paint_character_cp(deark *c, de_bitmap *img,
	struct de_bitmap_font *font, i32 codepoint,
	i64 xpos, i64 ypos, de_color fgcol, de_color bgcol, unsigned int flags)
{
	i64 char_idx;

	char_idx = get_char_idx_by_cp(c, font, codepoint);
	if(char_idx<0) {
		if(font->index_of_replacement_char>=0) {
			char_idx = font->index_of_replacement_char;
		}
	}
	if(char_idx<0) {
		char_idx = get_char_idx_by_cp(c, font, '?');
	}
	if(char_idx<0 || char_idx>=font->num_chars) {
		return;
	}
	de_font_paint_character_idx(c, img, font, char_idx, xpos, ypos, fgcol, bgcol, flags);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %r9, %rbx
movq %r8, %r14
movq %rdx, %r15
movq %rsi, %r12
movq %rdx, %rdi
movl %ecx, %esi
callq 0xf56f8
testq %rax, %rax
jns 0xf56c7
movq 0x8(%r15), %rax
testq %rax, %rax
jns 0xf56c7
movq %r15, %rdi
movl $0x3f, %esi
callq 0xf56f8
testq %rax, %rax
js 0xf56ec
cmpq 0x18(%r15), %rax
jge 0xf56ec
movq %r12, %rsi
movq %r15, %rdx
movq %rax, %rcx
movq %r14, %r8
movq %rbx, %r9
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0xf5372
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/deark-font.c
// Function: get_char_idx_by_cp
static i64 get_char_idx_by_cp(deark *c, struct de_bitmap_font *font, i32 codepoint)
{
	i64 i;

	// TODO: Sometimes, a font has multiple characters that map to the same
	// codepoint. We should have a way to find the *best* such character,
	// which might not be the first one.

	for(i=0; i<font->num_chars; i++) {
		if(font->has_unicode_codepoints) {
			if(font->char_array[i].codepoint_unicode == codepoint)
				return i;
		}
		else {
			if(font->char_array[i].codepoint_nonunicode == codepoint)
				return i;
		}
	}
	return -1;
}

// Assembly:
movq 0x18(%rdi), %rcx
movq $-0x1, %rax
testq %rcx, %rcx
jle 0xf5731
movb 0x11(%rdi), %dl
movq 0x20(%rdi), %rdi
addq $0x4, %rdi
xorl %r8d, %r8d
testb %dl, %dl
je 0xf5720
cmpl %esi, (%rdi)
jne 0xf5725
jmp 0xf5732
cmpl %esi, -0x4(%rdi)
je 0xf5732
incq %r8
addq $0x28, %rdi
cmpq %r8, %rcx
jne 0xf5716
retq
movq %r8, %rax
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/deark-font.c
// Function: de_font_decide_output_fmt
void de_font_decide_output_fmt(deark *c)
{
	const char *s;

	if(c->font_fmt_req) return;
	c->font_fmt_req = DE_FONTFMT_AUTO;
	s = de_get_ext_option(c, "font:output");
	if(s) {
		if(!de_strcmp(s, "font")) {
			c->font_fmt_req = DE_FONTFMT_FONT;
		}
		else if(!de_strcmp(s, "image")) {
			c->font_fmt_req = DE_FONTFMT_IMAGE;
		}
	}
}

// Assembly:
cmpb $0x0, 0xd5(%rdi)
je 0xf62c6
retq
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movb $0x1, 0xd5(%rdi)
leaq 0x53af5(%rip), %rsi     # 0x149dd0
callq 0xe9b74
testq %rax, %rax
je 0xf631a
movq %rax, %r14
leaq 0x40489(%rip), %rsi     # 0x136778
movq %rax, %rdi
callq 0x181a0
testl %eax, %eax
je 0xf6312
leaq 0x2ecf2(%rip), %rsi     # 0x124ff4
movq %r14, %rdi
callq 0x181a0
testl %eax, %eax
jne 0xf631a
movb $0x3, %al
jmp 0xf6314
movb $0x2, %al
movb %al, 0xd5(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/deark-font.c
// Function: draw_number
static void draw_number(deark *c, de_bitmap *img,
	struct de_bitmap_font *dfont, i64 n, i64 xpos1, i64 ypos1,
	unsigned int flags)
{
	char buf[32];
	i64 len;
	i64 i;
	i64 xpos_start;
	i64 xpos, ypos;

	if(flags & DNFLAG_HEX) {
		if(flags & DNFLAG_LEADING_ZEROES)
			de_snprintf(buf, sizeof(buf), "%04X", (unsigned int)n);
		else
			de_snprintf(buf, sizeof(buf), "%X", (unsigned int)n);
	}
	else {
		de_snprintf(buf, sizeof(buf), "%u", (unsigned int)n);
	}
	len = (i64)de_strlen(buf);

	if(flags & DNFLAG_HCENTER)
		xpos_start = xpos1-(dfont->nominal_width*len)/2;
	else
		xpos_start = xpos1-dfont->nominal_width*len;

	// Make sure number doesn't go beyond the image
	if(xpos_start + dfont->nominal_width*len > img->width) {
		xpos_start = img->width - dfont->nominal_width*len;
	}

	for(i=len-1; i>=0; i--) {
		xpos = xpos_start + dfont->nominal_width*i;
		ypos = ypos1-dfont->nominal_height;
		de_font_paint_character_cp(c, img, dfont, buf[i], xpos, ypos,
			DE_MAKE_GRAY(255), 0, DE_PAINTFLAG_TRNSBKGD);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %r9, %rbx
movq %r8, %r12
movq %rdx, %r14
movq %rsi, %r15
movl 0x60(%rsp), %ebp
testb $0x1, %bpl
jne 0xf634f
leaq 0x1f127(%rip), %rdx     # 0x115474
jmp 0xf6365
testb $0x2, %bpl
jne 0xf635e
leaq 0x53b36(%rip), %rdx     # 0x149e92
jmp 0xf6365
leaq 0x53b28(%rip), %rdx     # 0x149e8d
movq %rsp, %rdi
movl $0x20, %esi
xorl %eax, %eax
callq 0xe8193
movq %rsp, %rdi
callq 0x180e0
movq %rax, %r13
movslq (%r14), %rax
imulq %r13, %rax
testb $0x4, %bpl
jne 0xf6391
subq %rax, %r12
jmp 0xf63a1
movq %rax, %rcx
shrq $0x3f, %rcx
addq %rax, %rcx
sarq %rcx
subq %rcx, %r12
movq 0x8(%r15), %rcx
movq %rcx, %rbp
subq %rax, %rbp
addq %r12, %rax
cmpq %rcx, %rax
cmovleq %r12, %rbp
testq %r13, %r13
jle 0xf63ff
decq %r13
movslq (%r14), %r8
imulq %r13, %r8
addq %rbp, %r8
movslq 0x4(%r14), %rax
movq %rbx, %r9
subq %rax, %r9
movsbl (%rsp,%r13), %ecx
subq $0x8, %rsp
movq %r15, %rsi
movq %r14, %rdx
pushq $0x1
pushq $0x0
pushq $-0x1
callq 0xf5689
addq $0x20, %rsp
leaq -0x1(%r13), %rax
incq %r13
cmpq $0x1, %r13
movq %rax, %r13
ja 0xf63bd
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/deark-ucstring.c
// Function: ucstring_truncate
void ucstring_truncate(de_ucstring *s, i64 newlen)
{
	if(!s) return;
	if(newlen<0) newlen=0;
	if(newlen<s->len) s->len = newlen;

	if(s->tmp_string) {
		// There's no requirement to free tmp_string here, but it's no
		// longer needed, and maybe it's nice to have a way to do it.
		de_free(s->c, s->tmp_string);
		s->tmp_string = NULL;
	}
}

// Assembly:
testq %rdi, %rdi
je 0xf6460
pushq %rbx
movq %rdi, %rbx
xorl %eax, %eax
testq %rsi, %rsi
cmovgq %rsi, %rax
cmpq 0x10(%rdi), %rax
jge 0xf6446
movq %rax, 0x10(%rbx)
movq 0x20(%rbx), %rsi
testq %rsi, %rsi
je 0xf645f
movq (%rbx), %rdi
callq 0xe8be2
movq $0x0, 0x20(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/deark-ucstring.c
// Function: ucstring_delete_prefix
void ucstring_delete_prefix(de_ucstring *s, i64 nchars)
{
	i64 i;
	i64 new_len;

	if(nchars<1) return;
	if(nchars >= s->len) {
		ucstring_empty(s);
		return;
	}

	new_len = s->len - nchars;
	for(i=0; i<new_len; i++) {
		s->str[i] = s->str[nchars+i];
	}
	ucstring_truncate(s, new_len);
}

// Assembly:
testq %rsi, %rsi
jle 0xf6501
movq %rsi, %rax
movq 0x10(%rdi), %rsi
subq %rax, %rsi
jle 0xf6502
jle 0xf642a
movq 0x8(%rdi), %rcx
movq %rsi, %rdx
movl (%rcx,%rax,4), %r8d
movl %r8d, (%rcx)
addq $0x4, %rcx
decq %rdx
jne 0xf64ec
jmp 0xf642a
retq
xorl %esi, %esi
jmp 0xf642a
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/deark-ucstring.c
// Function: ucstring_append_ucstring
void ucstring_append_ucstring(de_ucstring *s1, const de_ucstring *s2)
{
	i64 i;

	if(!s2) return;
	// TODO: This could be done more efficiently.
	for(i=0; i<s2->len; i++) {
		ucstring_append_char(s1, s2->str[i]);
	}
}

// Assembly:
testq %rsi, %rsi
je 0xf6541
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
cmpq $0x0, 0x10(%rsi)
jle 0xf653c
movq %rdi, %r14
xorl %r15d, %r15d
movq 0x8(%rbx), %rax
movl (%rax,%r15,4), %esi
movq %r14, %rdi
callq 0xf6542
incq %r15
cmpq 0x10(%rbx), %r15
jl 0xf6523
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/deark-ucstring.c
// Function: ucstring_append_char
void ucstring_append_char(de_ucstring *s, de_rune ch)
{
	i64 new_len;
	i64 new_alloc;

	if(s->len >= 100000000) {
		return;
	}
	new_len = s->len + 1;
	if(new_len > s->alloc) {
		new_alloc = s->alloc * 2;
		if(new_alloc<32) new_alloc=32;
		s->str = de_reallocarray(s->c, s->str, s->alloc, sizeof(i32), new_alloc);
		s->alloc = new_alloc;
	}

	s->str[s->len] = ch;
	s->len++;
}

// Assembly:
movq 0x10(%rdi), %rcx
cmpq $0x5f5e0ff, %rcx        # imm = 0x5F5E0FF
jg 0xf65a7
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %ebp
movq %rdi, %rbx
movq 0x18(%rdi), %rdx
cmpq %rdx, %rcx
jge 0xf6567
movq 0x8(%rbx), %rax
jmp 0xf6599
leaq (%rdx,%rdx), %rax
cmpq $0x21, %rax
movl $0x20, %r14d
cmovgeq %rax, %r14
movq (%rbx), %rdi
movq 0x8(%rbx), %rsi
movl $0x4, %ecx
movq %r14, %r8
callq 0xe9758
movq %rax, 0x8(%rbx)
movq %r14, 0x18(%rbx)
movq 0x10(%rbx), %rcx
movl %ebp, (%rax,%rcx,4)
incq %rcx
movq %rcx, 0x10(%rbx)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/deark-ucstring.c
// Function: ucstring_append_sz
void ucstring_append_sz(de_ucstring *s, const char *sz, de_ext_encoding ee)
{
	i64 len;

	if(ee==DE_ENCODING_LATIN1) { // Fast path for this common case
		const u8 *sz_u8 = (const u8*)sz;

		while(*sz_u8) {
			ucstring_append_char(s, (de_rune)(*sz_u8));
			sz_u8++;
		}
		return;
	}

	len = (i64)de_strlen(sz);
	ucstring_append_bytes(s, (const u8*)sz, len, 0, ee);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rsi, %rbx
movq %rdi, %r14
cmpl $0x5, %edx
jne 0xf6619
movb (%rbx), %al
testb %al, %al
je 0xf6646
incq %rbx
movzbl %al, %esi
movq %r14, %rdi
callq 0xf6542
movb (%rbx), %al
incq %rbx
testb %al, %al
jne 0xf6603
jmp 0xf6646
movl %edx, %ebp
movq %rbx, %rdi
callq 0x180e0
movq %rax, %r15
movq %rsp, %r12
movq %r12, %rdi
movl %ebp, %esi
callq 0xebbf7
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
xorl %ecx, %ecx
movq %r12, %r8
callq 0xf67b3
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/deark-ucstring.c
// Function: ucstring_clone
de_ucstring *ucstring_clone(const de_ucstring *src)
{
	de_ucstring *dst;

	if(!src) return NULL;
	dst = ucstring_create(src->c);
	ucstring_append_ucstring(dst, src);
	return dst;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
testq %rdi, %rdi
je 0xf6747
movq %rdi, %rbx
movq (%rdi), %r15
movl $0x28, %esi
movq %r15, %rdi
callq 0xe8b2b
movq %rax, %r14
movq %r15, (%rax)
cmpq $0x0, 0x10(%rbx)
jle 0xf674a
xorl %r15d, %r15d
movq 0x8(%rbx), %rax
movl (%rax,%r15,4), %esi
movq %r14, %rdi
callq 0xf6542
incq %r15
cmpq 0x10(%rbx), %r15
jl 0xf672c
jmp 0xf674a
xorl %r14d, %r14d
movq %r14, %rax
popq %rbx
popq %r14
popq %r15
retq