// File: /workspace/github_c_makefile_star2_O0/oridb[P]mc/6/gengas.c
// Function: iprintf
void
iprintf(FILE *fd, Insn *insn)
{
	char *p;
	int i;
	int idx;

	/* x64 has a quirk; it has no movzlq because mov zero extends. Thi
	 * means that we need to do a movl when we really want a movzlq. Since
	 * we don't know the name of the reg to use, we need to sub it in when
	 * writing... */
	switch (insn->op) {
	case Imovzx:
		if (insn->args[0]->mode == ModeL && insn->args[1]->mode == ModeQ) {
			if (insn->args[1]->reg.colour) {
				insn->op = Imov;
				insn->args[1] = coreg(insn->args[1]->reg.colour, ModeL);
			}
		}
		if(dumbmov(insn->args[0], insn->args[1]))
			return;
		break;
	case Imovs:
		if(dumbmov(insn->args[0], insn->args[1]))
			return;
		break;
	case Imov:
		assert(!isfloatmode(insn->args[0]->mode));
		/* 
		 * if one reg is a subreg of another, we can just use the right
		 * mode to move between them, without any cost.
		 */
		if (issubreg(insn->args[0], insn->args[1]))
			insn->args[0] = coreg(insn->args[0]->reg.colour, insn->args[1]->mode);
		if(dumbmov(insn->args[0], insn->args[1]))
			return;
		break;
	default:
		break;
	}
	p = insnfmt[insn->op];
	i = 0;
	for (; *p; p++) {
		if (*p !=  '%') {
			fputc(*p, fd);
			continue;
		}

		/* %-formating */
		p++;
		idx = i;
again:
		switch (*p) {
		case '\0':
			goto done; /* skip the final p++ */
		case 'r': /* int register */
		case 'f': /* float register */
		case 'm': /* memory */
		case 'i': /* imm */
		case 'v': /* reg/mem */
		case 'u': /* reg/imm */
		case 'x': /* reg/mem/imm */
			locprint(fd, insn->args[idx], *p);
			i++;
			break;
		case 't':
			fputs(modenames[insn->args[idx]->mode], fd);
			break;
		default:
			/* the  asm description uses 1-based indexing, so that 0
			 * can be used as a sentinel. */
			if (!isdigit(*p))
				die("Invalid %%-specifier '%c'", *p);
			idx = strtol(p, &p, 10) - 1;
			goto again;
			break;
		}
	}
done
:
	return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movl 0x8(%rax), %eax
movl %eax, -0x24(%rbp)
subl $0x1, %eax
je 0x82af
jmp 0x81f5
movl -0x24(%rbp), %eax
subl $0x3, %eax
je 0x8210
jmp 0x81ff
movl -0x24(%rbp), %eax
subl $0x27, %eax
je 0x828b
jmp 0x8346
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
cmpl $0x3, 0x4(%rax)
jne 0x8267
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
cmpl $0x4, 0x4(%rax)
jne 0x8267
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
cmpl $0x0, 0x18(%rax)
je 0x8265
movq -0x10(%rbp), %rax
movl $0x1, 0x8(%rax)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movl 0x18(%rax), %edi
movl $0x3, %esi
callq 0x10240
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x18(%rax)
jmp 0x8267
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rsi
callq 0x110e0
cmpl $0x0, %eax
je 0x8286
jmp 0x84bf
jmp 0x8348
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rsi
callq 0x110e0
cmpl $0x0, %eax
je 0x82aa
jmp 0x84bf
jmp 0x8348
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movl 0x4(%rax), %edi
callq 0xfd70
cmpl $0x0, %eax
jne 0x82c6
jmp 0x82e5
leaq 0x4307e(%rip), %rdi     # 0x4b34b
leaq 0x43099(%rip), %rsi     # 0x4b36d
movl $0x89, %edx
leaq 0x43096(%rip), %rcx     # 0x4b376
callq 0x6160
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rsi
callq 0x11040
cmpl $0x0, %eax
je 0x8325
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movl 0x18(%rax), %edi
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movl 0x4(%rax), %esi
callq 0x10240
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rsi
callq 0x110e0
cmpl $0x0, %eax
je 0x8344
jmp 0x84bf
jmp 0x8348
jmp 0x8348
movq -0x10(%rbp), %rax
movl 0x8(%rax), %eax
movl %eax, %ecx
leaq 0x56e78(%rip), %rax     # 0x5f1d0
movq (%rax,%rcx,8), %rax
movq %rax, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
movq -0x18(%rbp), %rax
cmpb $0x0, (%rax)
je 0x84bb
movq -0x18(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x25, %eax
je 0x8395
movq -0x18(%rbp), %rax
movsbl (%rax), %edi
movq -0x8(%rbp), %rsi
callq 0x61d0
jmp 0x84aa
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
movl -0x1c(%rbp), %eax
movl %eax, -0x20(%rbp)
movq -0x18(%rbp), %rax
movsbl (%rax), %eax
movl %eax, -0x28(%rbp)
testl %eax, %eax
je 0x8400
jmp 0x83b7
movl -0x28(%rbp), %eax
subl $0x66, %eax
je 0x8405
jmp 0x83c1
movl -0x28(%rbp), %eax
subl $0x69, %eax
je 0x8405
jmp 0x83cb
movl -0x28(%rbp), %eax
subl $0x6d, %eax
je 0x8405
jmp 0x83d5
movl -0x28(%rbp), %eax
subl $0x72, %eax
je 0x8405
jmp 0x83df
movl -0x28(%rbp), %eax
subl $0x74, %eax
je 0x842d
jmp 0x83e9
movl -0x28(%rbp), %eax
addl $-0x75, %eax
subl $0x2, %eax
jb 0x8405
jmp 0x83f6
movl -0x28(%rbp), %eax
subl $0x78, %eax
je 0x8405
jmp 0x8455
jmp 0x84bd
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movslq -0x20(%rbp), %rcx
movq 0x10(%rax,%rcx,8), %rsi
movq -0x18(%rbp), %rax
movsbl (%rax), %edx
callq 0x7f20
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x84a8
movq -0x10(%rbp), %rax
movslq -0x20(%rbp), %rcx
movq 0x10(%rax,%rcx,8), %rax
movl 0x4(%rax), %eax
movl %eax, %ecx
leaq 0x56faa(%rip), %rax     # 0x5f3f0
movq (%rax,%rcx,8), %rdi
movq -0x8(%rbp), %rsi
callq 0x6170
jmp 0x84a8
callq 0x6370
movq (%rax), %rax
movq -0x18(%rbp), %rcx
movsbl (%rcx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x800, %eax            # imm = 0x800
cmpl $0x0, %eax
jne 0x848a
movq -0x18(%rbp), %rax
movsbl (%rax), %esi
leaq 0x42f10(%rip), %rdi     # 0x4b393
movb $0x0, %al
callq 0x1df20
movq -0x18(%rbp), %rdi
leaq -0x18(%rbp), %rsi
movl $0xa, %edx
callq 0x6250
subq $0x1, %rax
movl %eax, -0x20(%rbp)
jmp 0x83a7
jmp 0x84aa
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x8367
jmp 0x84bd
jmp 0x84bf
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)