// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/zip.c
// Function: describe_general_purpose_bit_flags
static void describe_general_purpose_bit_flags(deark *c, struct dir_entry_data *dd,
	de_ucstring *s)
{
	const char *name;
	UI bf = dd->bit_flags;

	if(bf & 0x0001) {
		ucstring_append_flags_item(s, "encrypted");
		bf -= 0x0001;
	}

	if(dd->cmpr_meth==6) { // implode
		if(bf & 0x0002) {
			name = "8K";
			bf -= 0x0002;
		}
		else {
			name = "4K";
		}
		ucstring_append_flags_itemf(s, "%s sliding dictionary", name);

		if(bf & 0x0004) {
			name = "3";
			bf -= 0x0004;
		}
		else {
			name = "2";
		}
		ucstring_append_flags_itemf(s, "%s trees", name);
	}

	if(dd->cmpr_meth==8 || dd->cmpr_meth==9) { // deflate flags
		UI code;

		code = (bf & 0x0006)>>1;
		switch(code) {
		case 1: name="max"; break;
		case 2: name="fast"; break;
		case 3: name="super_fast"; break;
		default: name="normal";
		}
		ucstring_append_flags_itemf(s, "cmprlevel=%s", name);
		bf -= (bf & 0x0006);
	}

	if(bf & 0x0008) {
		ucstring_append_flags_item(s, "uses data descriptor");
		bf -= 0x0008;
	}

	if(bf & 0x0800) {
		ucstring_append_flags_item(s, "UTF-8");
		bf -= 0x0800;
	}

	if(bf!=0) { // Report any unrecognized flags
		ucstring_append_flags_itemf(s, "0x%04x", bf);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x10(%rbp), %rax
movl 0x30(%rax), %eax
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x14a2d2
movq -0x18(%rbp), %rdi
leaq 0x83b83(%rip), %rsi     # 0x1cde47
callq 0x172680
movl -0x24(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x24(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x6, 0x20(%rax)
jne 0x14a364
movl -0x24(%rbp), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x14a301
leaq 0x6d95a(%rip), %rax     # 0x1b7c4c
movq %rax, -0x20(%rbp)
movl -0x24(%rbp), %eax
subl $0x2, %eax
movl %eax, -0x24(%rbp)
jmp 0x14a30c
leaq 0x8532f(%rip), %rax     # 0x1cf637
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rdx
leaq 0x8531f(%rip), %rsi     # 0x1cf63a
movb $0x0, %al
callq 0x1726d0
movl -0x24(%rbp), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x14a343
leaq 0x74b54(%rip), %rax     # 0x1bee88
movq %rax, -0x20(%rbp)
movl -0x24(%rbp), %eax
subl $0x4, %eax
movl %eax, -0x24(%rbp)
jmp 0x14a34e
leaq 0x82d28(%rip), %rax     # 0x1cd072
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rdx
leaq 0x852f3(%rip), %rsi     # 0x1cf650
movb $0x0, %al
callq 0x1726d0
movq -0x10(%rbp), %rax
cmpl $0x8, 0x20(%rax)
je 0x14a37c
movq -0x10(%rbp), %rax
cmpl $0x9, 0x20(%rax)
jne 0x14a3fe
movl -0x24(%rbp), %eax
andl $0x6, %eax
shrl %eax
movl %eax, -0x28(%rbp)
movl -0x28(%rbp), %eax
movl %eax, -0x2c(%rbp)
subl $0x1, %eax
je 0x14a3a8
jmp 0x14a394
movl -0x2c(%rbp), %eax
subl $0x2, %eax
je 0x14a3b5
jmp 0x14a39e
movl -0x2c(%rbp), %eax
subl $0x3, %eax
je 0x14a3c2
jmp 0x14a3cf
leaq 0x852aa(%rip), %rax     # 0x1cf659
movq %rax, -0x20(%rbp)
jmp 0x14a3da
leaq 0x852a7(%rip), %rax     # 0x1cf663
movq %rax, -0x20(%rbp)
jmp 0x14a3da
leaq 0x85294(%rip), %rax     # 0x1cf65d
movq %rax, -0x20(%rbp)
jmp 0x14a3da
leaq 0x80f20(%rip), %rax     # 0x1cb2f6
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rdx
leaq 0x8527f(%rip), %rsi     # 0x1cf668
movb $0x0, %al
callq 0x1726d0
movl -0x24(%rbp), %ecx
andl $0x6, %ecx
movl -0x24(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %eax
andl $0x8, %eax
cmpl $0x0, %eax
je 0x14a422
movq -0x18(%rbp), %rdi
leaq 0x85261(%rip), %rsi     # 0x1cf675
callq 0x172680
movl -0x24(%rbp), %eax
subl $0x8, %eax
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %eax
andl $0x800, %eax            # imm = 0x800
cmpl $0x0, %eax
je 0x14a44a
movq -0x18(%rbp), %rdi
leaq 0x657af(%rip), %rsi     # 0x1afbe9
callq 0x172680
movl -0x24(%rbp), %eax
subl $0x800, %eax            # imm = 0x800
movl %eax, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
je 0x14a465
movq -0x18(%rbp), %rdi
movl -0x24(%rbp), %edx
leaq 0x67484(%rip), %rsi     # 0x1b18e2
movb $0x0, %al
callq 0x1726d0
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)