// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/tiff.c
// Function: handler_various
static void handler_various(deark *c, lctx *d, const struct taginfo *tg, const struct tagnuminfo *tni)
{
	struct page_ctx *pg = tg->pg;
	i64 val;

	if(tg->valcount<1) return;
	read_tag_value_as_int64(c, d, tg, 0, &val);

	switch(tg->tagnum) {
	case TAG_NEWSUBFILETYPE:
		if(val & 0x1) pg->is_thumb = 1;
		break;
	case TAG_OLDSUBFILETYPE:
		pg->have_oldsubfiletype = 1;
		if(val==2) pg->is_thumb = 1;
		break;
	case TAG_IMAGEWIDTH:
		pg->have_imagewidth = 1;
		pg->imagewidth = val;
		break;
	case TAG_IMAGELENGTH:
		pg->imagelength = val;
		break;
	case TAG_COMPRESSION:
		pg->compression = (u32)val;
		break;
	case TAG_PHOTOMETRIC:
		pg->photometric = (u32)val;
		break;
	case TAG_FILLORDER:
		pg->fill_order = (u32)val;
		break;
	case TAG_SAMPLESPERPIXEL:
		pg->samples_per_pixel = (u32)val;
		break;
	case TAG_ROWSPERSTRIP:
		pg->have_strip_tags = 1;
		pg->rows_per_strip = val;
		break;
	case TAG_TILEWIDTH:
		pg->have_tile_tags = 1;
		pg->tile_width = val;
		break;
	case TAG_TILELENGTH:
		pg->have_tile_tags = 1;
		pg->tile_height = val;
		break;
	case TAG_ORIENTATION:
		if(val>=1 && val<=8) {
			pg->orientation = (u32)val;
		}
		break;
	case TAG_PLANARCONFIG:
		pg->planarconfig = (u32)val;
		break;
	case TAG_T4OPTIONS:
		pg->t4options = (u32)val;
		break;
	case TAG_T6OPTIONS:
		pg->t6options = (u32)val;
		break;
	case TAG_RESOLUTIONUNIT:
		pg->resolution_unit = (u32)val;
		break;
	case TAG_PREDICTOR:
		pg->predictor = (u32)val;
		break;
	case TAG_JPEGINTERCHANGEFORMAT:
		pg->jpegoffset = val;
		break;
	case TAG_JPEGINTERCHANGEFORMATLENGTH:
		pg->have_jpeglength = 1;
		pg->jpeglength = val;
		break;
	case TAG_YCBCRPOSITIONING:
		pg->ycbcrpositioning = (u32)val;
		break;
	case TAG_JPEGTABLES:
		pg->have_jpegtables = 1;
		break;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rax
cmpq $0x1, 0x18(%rax)
jge 0x1307e3
jmp 0x130af9
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
xorl %eax, %eax
movl %eax, %ecx
leaq -0x30(%rbp), %r8
callq 0x132fa0
movq -0x18(%rbp), %rax
movl 0x8(%rax), %eax
movl %eax, -0x34(%rbp)
subl $0xfe, %eax
je 0x130956
jmp 0x130813
movl -0x34(%rbp), %eax
subl $0xff, %eax
je 0x130971
jmp 0x130823
movl -0x34(%rbp), %eax
subl $0x100, %eax            # imm = 0x100
je 0x13098d
jmp 0x130833
movl -0x34(%rbp), %eax
subl $0x101, %eax            # imm = 0x101
je 0x1309a6
jmp 0x130843
movl -0x34(%rbp), %eax
subl $0x103, %eax            # imm = 0x103
je 0x1309b7
jmp 0x130853
movl -0x34(%rbp), %eax
subl $0x106, %eax            # imm = 0x106
je 0x1309c9
jmp 0x130863
movl -0x34(%rbp), %eax
subl $0x10a, %eax            # imm = 0x10A
je 0x1309db
jmp 0x130873
movl -0x34(%rbp), %eax
subl $0x112, %eax            # imm = 0x112
je 0x130a53
jmp 0x130883
movl -0x34(%rbp), %eax
subl $0x115, %eax            # imm = 0x115
je 0x1309ed
jmp 0x130893
movl -0x34(%rbp), %eax
subl $0x116, %eax            # imm = 0x116
je 0x1309ff
jmp 0x1308a3
movl -0x34(%rbp), %eax
subl $0x11c, %eax            # imm = 0x11C
je 0x130a73
jmp 0x1308b3
movl -0x34(%rbp), %eax
subl $0x124, %eax            # imm = 0x124
je 0x130a82
jmp 0x1308c3
movl -0x34(%rbp), %eax
subl $0x125, %eax            # imm = 0x125
je 0x130a91
jmp 0x1308d3
movl -0x34(%rbp), %eax
subl $0x128, %eax            # imm = 0x128
je 0x130aa0
jmp 0x1308e3
movl -0x34(%rbp), %eax
subl $0x13d, %eax            # imm = 0x13D
je 0x130aaf
jmp 0x1308f3
movl -0x34(%rbp), %eax
subl $0x142, %eax            # imm = 0x142
je 0x130a1b
jmp 0x130903
movl -0x34(%rbp), %eax
subl $0x143, %eax            # imm = 0x143
je 0x130a37
jmp 0x130913
movl -0x34(%rbp), %eax
subl $0x15b, %eax            # imm = 0x15B
je 0x130af1
jmp 0x130923
movl -0x34(%rbp), %eax
subl $0x201, %eax            # imm = 0x201
je 0x130abe
jmp 0x130933
movl -0x34(%rbp), %eax
subl $0x202, %eax            # imm = 0x202
je 0x130acc
jmp 0x130943
movl -0x34(%rbp), %eax
subl $0x213, %eax            # imm = 0x213
je 0x130ae2
jmp 0x130af9
movq -0x30(%rbp), %rax
andq $0x1, %rax
cmpq $0x0, %rax
je 0x13096c
movq -0x28(%rbp), %rax
movb $0x1, 0x13(%rax)
jmp 0x130af9
movq -0x28(%rbp), %rax
movb $0x1, 0x1a(%rax)
cmpq $0x2, -0x30(%rbp)
jne 0x130988
movq -0x28(%rbp), %rax
movb $0x1, 0x13(%rax)
jmp 0x130af9
movq -0x28(%rbp), %rax
movb $0x1, 0x11(%rax)
movq -0x30(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x60(%rax)
jmp 0x130af9
movq -0x30(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x68(%rax)
jmp 0x130af9
movq -0x30(%rbp), %rax
movl %eax, %ecx
movq -0x28(%rbp), %rax
movl %ecx, 0x1c(%rax)
jmp 0x130af9
movq -0x30(%rbp), %rax
movl %eax, %ecx
movq -0x28(%rbp), %rax
movl %ecx, 0x30(%rax)
jmp 0x130af9
movq -0x30(%rbp), %rax
movl %eax, %ecx
movq -0x28(%rbp), %rax
movl %ecx, 0x34(%rax)
jmp 0x130af9
movq -0x30(%rbp), %rax
movl %eax, %ecx
movq -0x28(%rbp), %rax
movl %ecx, 0x2c(%rax)
jmp 0x130af9
movq -0x28(%rbp), %rax
movb $0x1, 0x15(%rax)
movq -0x30(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x80(%rax)
jmp 0x130af9
movq -0x28(%rbp), %rax
movb $0x1, 0x16(%rax)
movq -0x30(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x88(%rax)
jmp 0x130af9
movq -0x28(%rbp), %rax
movb $0x1, 0x16(%rax)
movq -0x30(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x90(%rax)
jmp 0x130af9
cmpq $0x1, -0x30(%rbp)
jl 0x130a6e
cmpq $0x8, -0x30(%rbp)
jg 0x130a6e
movq -0x30(%rbp), %rax
movl %eax, %ecx
movq -0x28(%rbp), %rax
movl %ecx, 0x20(%rax)
jmp 0x130af9
movq -0x30(%rbp), %rax
movl %eax, %ecx
movq -0x28(%rbp), %rax
movl %ecx, 0x38(%rax)
jmp 0x130af9
movq -0x30(%rbp), %rax
movl %eax, %ecx
movq -0x28(%rbp), %rax
movl %ecx, 0x48(%rax)
jmp 0x130af9
movq -0x30(%rbp), %rax
movl %eax, %ecx
movq -0x28(%rbp), %rax
movl %ecx, 0x4c(%rax)
jmp 0x130af9
movq -0x30(%rbp), %rax
movl %eax, %ecx
movq -0x28(%rbp), %rax
movl %ecx, 0x44(%rax)
jmp 0x130af9
movq -0x30(%rbp), %rax
movl %eax, %ecx
movq -0x28(%rbp), %rax
movl %ecx, 0x3c(%rax)
jmp 0x130af9
movq -0x30(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x70(%rax)
jmp 0x130af9
movq -0x28(%rbp), %rax
movb $0x1, 0x12(%rax)
movq -0x30(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x78(%rax)
jmp 0x130af9
movq -0x30(%rbp), %rax
movl %eax, %ecx
movq -0x28(%rbp), %rax
movl %ecx, 0x24(%rax)
jmp 0x130af9
movq -0x28(%rbp), %rax
movb $0x1, 0x18(%rax)
addq $0x40, %rsp
popq %rbp
retq
nop