// File: /workspace/github_c_makefile_star2_O2/inflex[P]ripMIME/tnef/tnef.c
// Function: handle_props
int handle_props(uint8 *tsp)
{
	int bytes = 0;
	uint32 num_props = 0;
	uint32 x = 0;


	RT32(&num_props, tsp);
	bytes += sizeof(num_props);

	while (x < num_props)
	{
		uint32 prop_tag;
		uint32 num;
		char filename[256];

		RT32(&prop_tag, tsp+bytes);
		bytes += sizeof(prop_tag);

		switch (prop_tag & PROP_TYPE_MASK)
		{
			case PT_BINARY:
				RT32(&num, tsp+bytes);
				bytes += sizeof(num);
				RT32(&num, tsp+bytes);
				bytes += sizeof(num);
				if (prop_tag == PR_RTF_COMPRESSED)
				{
					sprintf (filename, "XAM_%d.rtf", TNEF_glb.file_num);
					TNEF_glb.file_num++;
					save_attach_data(filename, tsp+bytes, num);
				}
				/* num + PAD */
				bytes += num + ((num % 4) ? (4 - num%4) : 0);
				break;
			case PT_STRING8:
				RT32(&num, tsp+bytes);
				bytes += sizeof(num);
				RT32(&num, tsp+bytes);
				bytes += sizeof(num);
				make_string(tsp+bytes,num);
				bytes += num + ((num % 4) ? (4 - num%4) : 0);
				break;
			case PT_UNICODE:
			case PT_OBJECT:
				break;
			case PT_I2:
				bytes += 2;
				break;
			case PT_LONG:
				bytes += 4;
				break;
			case PT_R4:
				bytes += 4;
				break;
			case PT_DOUBLE:
				bytes += 8;
				break;
			case PT_CURRENCY:
			case PT_APPTIME:
			case PT_ERROR:
				bytes += 4;
				break;
			case PT_BOOLEAN:
				bytes += 4;
				break;
			case PT_I8:
				bytes += 8;
			case PT_SYSTIME:
				bytes += 8;
				break;
		}
		x++;
	}

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x118, %rsp            # imm = 0x118
movq %rdi, %r14
leaq 0xc(%rsp), %rdi
andl $0x0, (%rdi)
movq %r14, %rsi
callq 0xaf2b
pushq $-0x1
popq %rcx
cmpl $-0x1, %eax
je 0xb254
pushq $0x4
popq %rax
movl 0xc(%rsp), %ebp
leaq 0x8(%rsp), %r15
leaq 0xb1e1(%rip), %r12      # 0x162b0
movl %eax, %ebx
subl $0x1, %ebp
jb 0xb252
movslq %ebx, %rsi
addq %r14, %rsi
movq %r15, %rdi
callq 0xaf2b
cmpl $-0x1, %eax
je 0xb24d
leal 0x4(%rbx), %eax
movl 0x8(%rsp), %r13d
movzwl %r13w, %ecx
leal -0x2(%rcx), %edx
cmpl $0x12, %edx
ja 0xb115
movslq (%r12,%rdx,4), %rcx
addq %r12, %rcx
jmpq *%rcx
addl $0x8, %ebx
movl %ebx, %eax
jmp 0xb0cf
movslq %eax, %rsi
cmpl $0x1e, %ecx
je 0xb1d1
cmpl $0x40, %ecx
je 0xb1c9
cmpl $0x102, %ecx            # imm = 0x102
jne 0xb0cf
addq %r14, %rsi
leaq 0x4(%rsp), %rdi
callq 0xaf2b
cmpl $-0x1, %eax
je 0xb24d
leal 0x8(%rbx), %eax
movslq %eax, %rsi
addq %r14, %rsi
leaq 0x4(%rsp), %rdi
callq 0xaf2b
cmpl $-0x1, %eax
je 0xb24d
addl $0xc, %ebx
cmpl $0x10090102, %r13d      # imm = 0x10090102
jne 0xb22c
movl 0x22d66(%rip), %edx     # 0x2dee0
leaq 0x10(%rsp), %rdi
leaq 0xb248(%rip), %rsi      # 0x163ce
xorl %eax, %eax
callq 0x2370
incl 0x22d4d(%rip)           # 0x2dee0
movslq %ebx, %rsi
addq %r14, %rsi
movl 0x4(%rsp), %r13d
leaq 0x10(%rsp), %rdi
movl %r13d, %edx
callq 0xafe5
jmp 0xb231
addl $0xc, %ebx
movl %ebx, %eax
jmp 0xb0cf
addl $0x6, %ebx
movl %ebx, %eax
jmp 0xb0cf
addl $0xc, %ebx
movl %ebx, %eax
addl $0x8, %eax
jmp 0xb0cf
addq %r14, %rsi
leaq 0x4(%rsp), %rdi
callq 0xaf2b
cmpl $-0x1, %eax
je 0xb24d
leal 0x8(%rbx), %eax
movslq %eax, %rsi
addq %r14, %rsi
leaq 0x4(%rsp), %rdi
callq 0xaf2b
cmpl $-0x1, %eax
je 0xb24d
leal 0xc(%rbx), %eax
movslq %eax, %rdi
addq %r14, %rdi
movl 0x4(%rsp), %r13d
callq 0xafbf
movl %r13d, %eax
andl $0x3, %eax
pushq $0x4
popq %rcx
subl %eax, %ecx
testl %eax, %eax
cmovel %eax, %ecx
leal (%rbx,%r13), %eax
addl $0xc, %eax
addl %ecx, %eax
jmp 0xb0cf
movl 0x4(%rsp), %r13d
movl %r13d, %eax
andl $0x3, %eax
pushq $0x4
popq %rcx
subl %eax, %ecx
testl %eax, %eax
cmovel %eax, %ecx
addl %r13d, %ebx
addl %ecx, %ebx
movl %ebx, %eax
jmp 0xb0cf
pushq $-0x1
popq %rcx
jmp 0xb254
xorl %ecx, %ecx
movl %ecx, %eax
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq