// File: /workspace/github_c_makefile_star2_O3/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
movl $0x0, (%rdi)
movq %r14, %rsi
callq 0xb30e
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
cmpl $-0x1, %eax
je 0xb65f
movl 0xc(%rsp), %r13d
testl %r13d, %r13d
je 0xb656
movl $0x4, %ebx
leaq 0x8(%rsp), %r15
leaq 0xbde5(%rip), %r12      # 0x172b0
movslq %ebx, %rsi
addq %r14, %rsi
movq %r15, %rdi
callq 0xb30e
cmpl $-0x1, %eax
je 0xb65a
leal 0x4(%rbx), %eax
movl 0x8(%rsp), %ebp
movzwl %bp, %ecx
cmpl $0x1d, %ecx
jg 0xb513
addl $-0x2, %ecx
cmpl $0x12, %ecx
ja 0xb507
movslq (%r12,%rcx,4), %rcx
addq %r12, %rcx
jmpq *%rcx
addl $0x8, %ebx
movl %ebx, %eax
movl %eax, %ebx
decl %r13d
jne 0xb4cb
jmp 0xb656
cmpl $0x1e, %ecx
je 0xb5c8
cmpl $0x40, %ecx
je 0xb5b8
cmpl $0x102, %ecx            # imm = 0x102
jne 0xb507
movslq %eax, %rsi
addq %r14, %rsi
leaq 0x4(%rsp), %rdi
callq 0xb30e
cmpl $-0x1, %eax
je 0xb65a
leal 0x8(%rbx), %eax
movslq %eax, %rsi
addq %r14, %rsi
leaq 0x4(%rsp), %rdi
callq 0xb30e
cmpl $-0x1, %eax
je 0xb65a
addl $0xc, %ebx
cmpl $0x10090102, %ebp       # imm = 0x10090102
jne 0xb638
movl 0x23969(%rip), %edx     # 0x2eee0
leaq 0x10(%rsp), %rdi
leaq 0xbe4b(%rip), %rsi      # 0x173ce
xorl %eax, %eax
callq 0x2360
incl 0x23950(%rip)           # 0x2eee0
movslq %ebx, %rsi
addq %r14, %rsi
movl 0x4(%rsp), %ebp
leaq 0x10(%rsp), %rdi
movl %ebp, %edx
callq 0xb3cc
jmp 0xb63c
addl $0x6, %ebx
jmp 0xb505
addl $0xc, %ebx
movl %ebx, %eax
addl $0x8, %eax
jmp 0xb507
addl $0xc, %ebx
jmp 0xb505
movslq %eax, %rsi
addq %r14, %rsi
leaq 0x4(%rsp), %rdi
callq 0xb30e
cmpl $-0x1, %eax
je 0xb65a
leal 0x8(%rbx), %eax
movslq %eax, %rsi
addq %r14, %rsi
leaq 0x4(%rsp), %rdi
callq 0xb30e
cmpl $-0x1, %eax
je 0xb65a
leal 0xc(%rbx), %eax
movslq %eax, %rcx
addq %r14, %rcx
movl $0x100, %esi            # imm = 0x100
leaq 0x23d16(%rip), %rdi     # 0x2f320
leaq 0xca4f(%rip), %rdx      # 0x18060
xorl %eax, %eax
callq 0x2140
movl 0x4(%rsp), %ecx
leal (%rcx,%rbx), %eax
addl $0xc, %eax
andl $0x3, %ecx
movl $0x4, %edx
subl %ecx, %edx
testl %ecx, %ecx
cmovel %ecx, %edx
addl %edx, %eax
jmp 0xb507
movl 0x4(%rsp), %ebp
movl %ebp, %eax
andl $0x3, %eax
movl $0x4, %ecx
subl %eax, %ecx
testl %eax, %eax
cmovel %eax, %ecx
addl %ebp, %ebx
addl %ecx, %ebx
jmp 0xb505
xorl %ecx, %ecx
jmp 0xb65f
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
movl %ecx, %eax
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq