// File: /workspace/github_c_makefile_star2_O0/oridb[P]mc/6/isel.c
// Function: epilogue
static void
epilogue(Isel *s)
{
	Loc *rsp, *rbp;
	Loc *ret;
	size_t i;
	size_t ri = 0, rf = 0;

	rsp = locphysreg(Rrsp);
	rbp = locphysreg(Rrbp);
	switch (s->rettype) {
	case ArgVoid:
		break;
	case ArgReg:
		/* s->ret is a value, and will be returned that way */
		ret = loc(s, s->ret);
		if (istyfloat(exprtype(s->ret)))
			g(s, Imovs, ret, coreg(Rxmm0d, ret->mode), NULL);
		else
			g(s, Imov, ret, coreg(Rax, ret->mode), NULL);
		break;
	case ArgBig:
		/* s->ret is an address, and will be returned that way */
		ret = loc(s, s->ret);
		g(s, Imov, ret, coreg(Rax, ret->mode), NULL);
		break;
	case ArgAggrI:
		/* s->ret is an address, and will be returned as values */
		ret = loc(s, s->ret);
		load(s, locmem(0, ret, NULL, ModeQ), coreg(intretregs[ri++], ModeQ));
		break;
	case ArgAggrF:
		ret = loc(s, s->ret);
		load(s, locmem(0, ret, NULL, ModeD), coreg(fltretregs[rf++], ModeD));
		break;
	case ArgAggrII:
		ret = loc(s, s->ret);
		load(s, locmem(0, ret, NULL, ModeQ), coreg(intretregs[ri++], ModeQ));
		load(s, locmem(8, ret, NULL, ModeQ), coreg(intretregs[ri++], ModeQ));
		break;
	case ArgAggrIF:
		ret = loc(s, s->ret);
		load(s, locmem(0, ret, NULL, ModeQ), coreg(intretregs[ri++], ModeQ));
		load(s, locmem(8, ret, NULL, ModeD), coreg(fltretregs[rf++], ModeD));
		break;
	case ArgAggrFI:
		ret = loc(s, s->ret);
		load(s, locmem(0, ret, NULL, ModeD), coreg(fltretregs[rf++], ModeD));
		load(s, locmem(8, ret, NULL, ModeQ), coreg(intretregs[ri++], ModeQ));
		break;
	case ArgAggrFF:
		ret = loc(s, s->ret);
		load(s, locmem(0, ret, NULL, ModeD), coreg(fltretregs[rf++], ModeD));
		load(s, locmem(8, ret, NULL, ModeD), coreg(fltretregs[rf++], ModeD));
		break;
	}

	/* restore registers */
	for (i = 0; savedregs[i] != Rnone; i++)
		if (isfloatmode(s->calleesave[i]->mode))
			g(s, Imovs, s->calleesave[i], locphysreg(savedregs[i]), NULL);
		else
			g(s, Imov, s->calleesave[i], locphysreg(savedregs[i]), NULL);
	/* leave function */
	g(s, Imov, rbp, rsp, NULL);
	g(s, Ipop, rbp, NULL);
	g(s, Iret, NULL);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x130, %rsp            # imm = 0x130
movq %rdi, -0x8(%rbp)
movq $0x0, -0x30(%rbp)
movq $0x0, -0x38(%rbp)
movl $0x3b, %edi
callq 0xffc0
movq %rax, -0x10(%rbp)
movl $0x3c, %edi
callq 0xffc0
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rax
movl 0x38(%rax), %eax
movq %rax, -0x40(%rbp)
subq $0x8, %rax
ja 0xf0b1
movq -0x40(%rbp), %rax
leaq 0x3da49(%rip), %rcx     # 0x4c574
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
jmp 0xf0b1
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rsi
callq 0xd570
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rdi
callq 0x30340
movq %rax, %rdi
callq 0x37930
cmpl $0x0, %eax
je 0xeba7
movq -0x8(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x20(%rbp), %rax
movl 0x4(%rax), %esi
movl $0x55, %edi
callq 0x10240
movq -0x50(%rbp), %rdi
movq -0x48(%rbp), %rdx
movq %rax, %rcx
movl $0x27, %esi
xorl %eax, %eax
movl %eax, %r8d
movb $0x0, %al
callq 0xbf80
jmp 0xebe4
movq -0x8(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x20(%rbp), %rax
movl 0x4(%rax), %esi
movl $0x15, %edi
callq 0x10240
movq -0x60(%rbp), %rdi
movq -0x58(%rbp), %rdx
movq %rax, %rcx
movl $0x1, %esi
xorl %eax, %eax
movl %eax, %r8d
movb $0x0, %al
callq 0xbf80
jmp 0xf0b1
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rsi
callq 0xd570
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x70(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x20(%rbp), %rax
movl 0x4(%rax), %esi
movl $0x15, %edi
callq 0x10240
movq -0x70(%rbp), %rdi
movq -0x68(%rbp), %rdx
movq %rax, %rcx
movl $0x1, %esi
xorl %eax, %eax
movl %eax, %r8d
movb $0x0, %al
callq 0xbf80
jmp 0xf0b1
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rsi
callq 0xd570
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x80(%rbp)
movq -0x20(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
movl $0x4, %ecx
movq %rdx, %rdi
callq 0x10050
movq %rax, -0x78(%rbp)
movq -0x30(%rbp), %rcx
movq %rcx, %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
leaq 0x510e4(%rip), %rax     # 0x5fd70
movq (%rax,%rcx,8), %rax
movl %eax, %edi
movl $0x4, %esi
callq 0x10240
movq -0x80(%rbp), %rdi
movq -0x78(%rbp), %rsi
movq %rax, %rdx
callq 0xf200
jmp 0xf0b1
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rsi
callq 0xd570
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x90(%rbp)
movq -0x20(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
movl $0x6, %ecx
movq %rdx, %rdi
callq 0x10050
movq %rax, -0x88(%rbp)
movq -0x38(%rbp), %rcx
movq %rcx, %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
leaq 0x5105d(%rip), %rax     # 0x5fd60
movq (%rax,%rcx,8), %rax
movl %eax, %edi
movl $0x6, %esi
callq 0x10240
movq -0x90(%rbp), %rdi
movq -0x88(%rbp), %rsi
movq %rax, %rdx
callq 0xf200
jmp 0xf0b1
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rsi
callq 0xd570
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0xb0(%rbp)
movq -0x20(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
movl $0x4, %ecx
movq %rdx, %rdi
callq 0x10050
movq %rax, -0xa8(%rbp)
movq -0x30(%rbp), %rcx
movq %rcx, %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
leaq 0x50ff0(%rip), %rax     # 0x5fd70
movq (%rax,%rcx,8), %rax
movl %eax, %edi
movl $0x4, %esi
callq 0x10240
movq -0xb0(%rbp), %rdi
movq -0xa8(%rbp), %rsi
movq %rax, %rdx
callq 0xf200
movq -0x8(%rbp), %rax
movq %rax, -0xa0(%rbp)
movq -0x20(%rbp), %rsi
movl $0x8, %edi
xorl %eax, %eax
movl %eax, %edx
movl $0x4, %ecx
callq 0x10050
movq %rax, -0x98(%rbp)
movq -0x30(%rbp), %rcx
movq %rcx, %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
leaq 0x50f8b(%rip), %rax     # 0x5fd70
movq (%rax,%rcx,8), %rax
movl %eax, %edi
movl $0x4, %esi
callq 0x10240
movq -0xa0(%rbp), %rdi
movq -0x98(%rbp), %rsi
movq %rax, %rdx
callq 0xf200
jmp 0xf0b1
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rsi
callq 0xd570
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0xd0(%rbp)
movq -0x20(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
movl $0x4, %ecx
movq %rdx, %rdi
callq 0x10050
movq %rax, -0xc8(%rbp)
movq -0x30(%rbp), %rcx
movq %rcx, %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
leaq 0x50f0e(%rip), %rax     # 0x5fd70
movq (%rax,%rcx,8), %rax
movl %eax, %edi
movl $0x4, %esi
callq 0x10240
movq -0xd0(%rbp), %rdi
movq -0xc8(%rbp), %rsi
movq %rax, %rdx
callq 0xf200
movq -0x8(%rbp), %rax
movq %rax, -0xc0(%rbp)
movq -0x20(%rbp), %rsi
movl $0x8, %edi
xorl %eax, %eax
movl %eax, %edx
movl $0x6, %ecx
callq 0x10050
movq %rax, -0xb8(%rbp)
movq -0x38(%rbp), %rcx
movq %rcx, %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
leaq 0x50e99(%rip), %rax     # 0x5fd60
movq (%rax,%rcx,8), %rax
movl %eax, %edi
movl $0x6, %esi
callq 0x10240
movq -0xc0(%rbp), %rdi
movq -0xb8(%rbp), %rsi
movq %rax, %rdx
callq 0xf200
jmp 0xf0b1
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rsi
callq 0xd570
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0xf0(%rbp)
movq -0x20(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
movl $0x6, %ecx
movq %rdx, %rdi
callq 0x10050
movq %rax, -0xe8(%rbp)
movq -0x38(%rbp), %rcx
movq %rcx, %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
leaq 0x50e1c(%rip), %rax     # 0x5fd60
movq (%rax,%rcx,8), %rax
movl %eax, %edi
movl $0x6, %esi
callq 0x10240
movq -0xf0(%rbp), %rdi
movq -0xe8(%rbp), %rsi
movq %rax, %rdx
callq 0xf200
movq -0x8(%rbp), %rax
movq %rax, -0xe0(%rbp)
movq -0x20(%rbp), %rsi
movl $0x8, %edi
xorl %eax, %eax
movl %eax, %edx
movl $0x4, %ecx
callq 0x10050
movq %rax, -0xd8(%rbp)
movq -0x30(%rbp), %rcx
movq %rcx, %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
leaq 0x50dc7(%rip), %rax     # 0x5fd70
movq (%rax,%rcx,8), %rax
movl %eax, %edi
movl $0x4, %esi
callq 0x10240
movq -0xe0(%rbp), %rdi
movq -0xd8(%rbp), %rsi
movq %rax, %rdx
callq 0xf200
jmp 0xf0b1
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rsi
callq 0xd570
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x110(%rbp)
movq -0x20(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
movl $0x6, %ecx
movq %rdx, %rdi
callq 0x10050
movq %rax, -0x108(%rbp)
movq -0x38(%rbp), %rcx
movq %rcx, %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
leaq 0x50d3a(%rip), %rax     # 0x5fd60
movq (%rax,%rcx,8), %rax
movl %eax, %edi
movl $0x6, %esi
callq 0x10240
movq -0x110(%rbp), %rdi
movq -0x108(%rbp), %rsi
movq %rax, %rdx
callq 0xf200
movq -0x8(%rbp), %rax
movq %rax, -0x100(%rbp)
movq -0x20(%rbp), %rsi
movl $0x8, %edi
xorl %eax, %eax
movl %eax, %edx
movl $0x6, %ecx
callq 0x10050
movq %rax, -0xf8(%rbp)
movq -0x38(%rbp), %rcx
movq %rcx, %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
leaq 0x50cd5(%rip), %rax     # 0x5fd60
movq (%rax,%rcx,8), %rax
movl %eax, %edi
movl $0x6, %esi
callq 0x10240
movq -0x100(%rbp), %rdi
movq -0xf8(%rbp), %rsi
movq %rax, %rdx
callq 0xf200
movq $0x0, -0x28(%rbp)
movq -0x28(%rbp), %rcx
leaq 0x5113c(%rip), %rax     # 0x60200
cmpl $0x0, (%rax,%rcx,4)
je 0xf1a5
movq -0x8(%rbp), %rax
movq -0x28(%rbp), %rcx
movq 0x78(%rax,%rcx,8), %rax
movl 0x4(%rax), %edi
callq 0xfd70
cmpl $0x0, %eax
je 0xf13e
movq -0x8(%rbp), %rax
movq %rax, -0x120(%rbp)
movq -0x8(%rbp), %rax
movq -0x28(%rbp), %rcx
movq 0x78(%rax,%rcx,8), %rax
movq %rax, -0x118(%rbp)
movq -0x28(%rbp), %rcx
leaq 0x510ee(%rip), %rax     # 0x60200
movl (%rax,%rcx,4), %edi
callq 0xffc0
movq -0x120(%rbp), %rdi
movq -0x118(%rbp), %rdx
movq %rax, %rcx
movl $0x27, %esi
xorl %eax, %eax
movl %eax, %r8d
movb $0x0, %al
callq 0xbf80
jmp 0xf192
movq -0x8(%rbp), %rax
movq %rax, -0x130(%rbp)
movq -0x8(%rbp), %rax
movq -0x28(%rbp), %rcx
movq 0x78(%rax,%rcx,8), %rax
movq %rax, -0x128(%rbp)
movq -0x28(%rbp), %rcx
leaq 0x51098(%rip), %rax     # 0x60200
movl (%rax,%rcx,4), %edi
callq 0xffc0
movq -0x130(%rbp), %rdi
movq -0x128(%rbp), %rdx
movq %rax, %rcx
movl $0x1, %esi
xorl %eax, %eax
movl %eax, %r8d
movb $0x0, %al
callq 0xbf80
jmp 0xf194
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0xf0b9
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rdx
movq -0x10(%rbp), %rcx
movl $0x1, %esi
xorl %eax, %eax
movl %eax, %r8d
movb $0x0, %al
callq 0xbf80
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rdx
movl $0x1c, %esi
xorl %eax, %eax
movl %eax, %ecx
movb $0x0, %al
callq 0xbf80
movq -0x8(%rbp), %rdi
movl $0x3f, %esi
xorl %eax, %eax
movl %eax, %edx
movb $0x0, %al
callq 0xbf80
addq $0x130, %rsp            # imm = 0x130
popq %rbp
retq
nopw (%rax,%rax)