// File: /workspace/github_c_makefile_star2_O0/oridb[P]mc/parse/type.c
// Function: iterableinit
void
iterableinit(Stab *st, Trait *tr)
{
	Node *func, *arg, **args;
	Type *ty;
	size_t nargs;

	/* trait iter @a -> @b = ... */
	tr->param = mktyparam(Zloc, "a");
	tr->aux = malloc(sizeof(Type*));
	tr->aux[0] = mktyparam(Zloc, "b");
	tr->naux = 1;

	/* __iternext__ : (it : @a#, outval : @b# -> bool) */
	args = NULL;
	nargs = 0;
	arg = mkdecl(Zloc, mkname(Zloc, "iter"), mktyptr(Zloc, mktyparam(Zloc, "a")));
	lappend(&args, &nargs, arg);
	arg = mkdecl(Zloc, mkname(Zloc, "ret"), mktyptr(Zloc, mktyparam(Zloc, "b")));
	lappend(&args, &nargs, arg);
	ty = mktyfunc(Zloc, args, nargs, mktype(Zloc, Tybool));

	func = mkdecl(Zloc, mkname(Zloc, "__iternext__"), ty);
	func->decl.trait = tr;
	func->decl.impls = mkht(tyhash, tyeq);
	func->decl.isgeneric = 1;
	func->decl.isconst = 1;
	func->decl.isglobl = 1;
	func->decl.isextern = 1;

	lappend(&tr->proto, &tr->nproto, func);
	putdcl(st, func);

	/* __iterfin__ : (it : @a#, outval : @b# -> void) */
	args = NULL;
	nargs = 0;
	arg = mkdecl(Zloc, mkname(Zloc, "iter"), mktyptr(Zloc, mktyparam(Zloc, "a")));
	lappend(&args, &nargs, arg);
	arg = mkdecl(Zloc, mkname(Zloc, "val"), mktyptr(Zloc, mktyparam(Zloc, "b")));
	lappend(&args, &nargs, arg);
	ty = mktyfunc(Zloc, args, nargs, mktype(Zloc, Tyvoid));

	func = mkdecl(Zloc, mkname(Zloc, "__iterfin__"), ty);
	func->decl.trait = tr;
	func->decl.impls = mkht(tyhash, tyeq);
	func->decl.isgeneric = 1;
	func->decl.isconst = 1;
	func->decl.isglobl = 1;
	func->decl.isextern = 1;

	lappend(&tr->proto, &tr->nproto, func);
	putdcl(st, func);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x150, %rsp            # imm = 0x150
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0xffffffff, -0x40(%rbp) # imm = 0xFFFFFFFF
movl $0x0, -0x3c(%rbp)
movq -0x40(%rbp), %rdi
leaq 0x17876(%rip), %rsi     # 0x514c2
callq 0x370f0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x18(%rax)
movl $0x8, %edi
callq 0x6280
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x20(%rax)
movl $0xffffffff, -0x48(%rbp) # imm = 0xFFFFFFFF
movl $0x0, -0x44(%rbp)
movq -0x48(%rbp), %rdi
leaq 0x11957(%rip), %rsi     # 0x4b5e1
callq 0x370f0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
movq $0x1, 0x28(%rax)
movq $0x0, -0x28(%rbp)
movq $0x0, -0x38(%rbp)
movl $0xffffffff, -0x50(%rbp) # imm = 0xFFFFFFFF
movl $0x0, -0x4c(%rbp)
movl $0xffffffff, -0x58(%rbp) # imm = 0xFFFFFFFF
movl $0x0, -0x54(%rbp)
movq -0x58(%rbp), %rdi
leaq 0x1a426(%rip), %rsi     # 0x54106
callq 0x2f540
movq %rax, -0x148(%rbp)
movl $0xffffffff, -0x60(%rbp) # imm = 0xFFFFFFFF
movl $0x0, -0x5c(%rbp)
movl $0xffffffff, -0x68(%rbp) # imm = 0xFFFFFFFF
movl $0x0, -0x64(%rbp)
movq -0x68(%rbp), %rdi
leaq 0x177af(%rip), %rsi     # 0x514c2
callq 0x370f0
movq %rax, %rsi
movq -0x60(%rbp), %rdi
callq 0x37430
movq -0x148(%rbp), %rsi
movq %rax, %rdx
movq -0x50(%rbp), %rdi
callq 0x2ff20
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdx
leaq -0x28(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x48290
movl $0xffffffff, -0x70(%rbp) # imm = 0xFFFFFFFF
movl $0x0, -0x6c(%rbp)
movl $0xffffffff, -0x78(%rbp) # imm = 0xFFFFFFFF
movl $0x0, -0x74(%rbp)
movq -0x78(%rbp), %rdi
leaq 0x18e84(%rip), %rsi     # 0x52bf7
callq 0x2f540
movq %rax, -0x140(%rbp)
movl $0xffffffff, -0x80(%rbp) # imm = 0xFFFFFFFF
movl $0x0, -0x7c(%rbp)
movl $0xffffffff, -0x88(%rbp) # imm = 0xFFFFFFFF
movl $0x0, -0x84(%rbp)
movq -0x88(%rbp), %rdi
leaq 0x11832(%rip), %rsi     # 0x4b5e1
callq 0x370f0
movq %rax, %rsi
movq -0x80(%rbp), %rdi
callq 0x37430
movq -0x140(%rbp), %rsi
movq %rax, %rdx
movq -0x70(%rbp), %rdi
callq 0x2ff20
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdx
leaq -0x28(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x48290
movl $0xffffffff, -0x90(%rbp) # imm = 0xFFFFFFFF
movl $0x0, -0x8c(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x138(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x130(%rbp)
movl $0xffffffff, -0x98(%rbp) # imm = 0xFFFFFFFF
movl $0x0, -0x94(%rbp)
movq -0x98(%rbp), %rdi
movl $0x2, %esi
callq 0x36c10
movq -0x138(%rbp), %rsi
movq -0x130(%rbp), %rdx
movq %rax, %rcx
movq -0x90(%rbp), %rdi
callq 0x37520
movq %rax, -0x30(%rbp)
movl $0xffffffff, -0xa0(%rbp) # imm = 0xFFFFFFFF
movl $0x0, -0x9c(%rbp)
movl $0xffffffff, -0xa8(%rbp) # imm = 0xFFFFFFFF
movl $0x0, -0xa4(%rbp)
movq -0xa8(%rbp), %rdi
leaq 0x1a27d(%rip), %rsi     # 0x5410b
callq 0x2f540
movq %rax, %rsi
movq -0x30(%rbp), %rdx
movq -0xa0(%rbp), %rdi
callq 0x2ff20
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x40(%rax)
leaq -0x146d(%rip), %rdi     # 0x38a50
leaq -0xb64(%rip), %rsi      # 0x39360
callq 0x48fe0
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x48(%rax)
movq -0x18(%rbp), %rax
movb $0x1, 0x73(%rax)
movq -0x18(%rbp), %rax
movb $0x1, 0x72(%rax)
movq -0x18(%rbp), %rax
movb $0x1, 0x71(%rax)
movq -0x18(%rbp), %rax
movb $0x1, 0x74(%rax)
movq -0x10(%rbp), %rdi
addq $0x30, %rdi
movq -0x10(%rbp), %rsi
addq $0x38, %rsi
movq -0x18(%rbp), %rdx
callq 0x48290
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x33970
movq $0x0, -0x28(%rbp)
movq $0x0, -0x38(%rbp)
movl $0xffffffff, -0xb0(%rbp) # imm = 0xFFFFFFFF
movl $0x0, -0xac(%rbp)
movl $0xffffffff, -0xb8(%rbp) # imm = 0xFFFFFFFF
movl $0x0, -0xb4(%rbp)
movq -0xb8(%rbp), %rdi
leaq 0x1a1a6(%rip), %rsi     # 0x54106
callq 0x2f540
movq %rax, -0x128(%rbp)
movl $0xffffffff, -0xc0(%rbp) # imm = 0xFFFFFFFF
movl $0x0, -0xbc(%rbp)
movl $0xffffffff, -0xc8(%rbp) # imm = 0xFFFFFFFF
movl $0x0, -0xc4(%rbp)
movq -0xc8(%rbp), %rdi
leaq 0x17520(%rip), %rsi     # 0x514c2
callq 0x370f0
movq %rax, %rsi
movq -0xc0(%rbp), %rdi
callq 0x37430
movq -0x128(%rbp), %rsi
movq %rax, %rdx
movq -0xb0(%rbp), %rdi
callq 0x2ff20
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdx
leaq -0x28(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x48290
movl $0xffffffff, -0xd0(%rbp) # imm = 0xFFFFFFFF
movl $0x0, -0xcc(%rbp)
movl $0xffffffff, -0xd8(%rbp) # imm = 0xFFFFFFFF
movl $0x0, -0xd4(%rbp)
movq -0xd8(%rbp), %rdi
leaq 0x1a101(%rip), %rsi     # 0x54118
callq 0x2f540
movq %rax, -0x120(%rbp)
movl $0xffffffff, -0xe0(%rbp) # imm = 0xFFFFFFFF
movl $0x0, -0xdc(%rbp)
movl $0xffffffff, -0xe8(%rbp) # imm = 0xFFFFFFFF
movl $0x0, -0xe4(%rbp)
movq -0xe8(%rbp), %rdi
leaq 0x11588(%rip), %rsi     # 0x4b5e1
callq 0x370f0
movq %rax, %rsi
movq -0xe0(%rbp), %rdi
callq 0x37430
movq -0x120(%rbp), %rsi
movq %rax, %rdx
movq -0xd0(%rbp), %rdi
callq 0x2ff20
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdx
leaq -0x28(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x48290
movl $0xffffffff, -0xf0(%rbp) # imm = 0xFFFFFFFF
movl $0x0, -0xec(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x118(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x110(%rbp)
movl $0xffffffff, -0xf8(%rbp) # imm = 0xFFFFFFFF
movl $0x0, -0xf4(%rbp)
movq -0xf8(%rbp), %rdi
movl $0x1, %esi
callq 0x36c10
movq -0x118(%rbp), %rsi
movq -0x110(%rbp), %rdx
movq %rax, %rcx
movq -0xf0(%rbp), %rdi
callq 0x37520
movq %rax, -0x30(%rbp)
movl $0xffffffff, -0x100(%rbp) # imm = 0xFFFFFFFF
movl $0x0, -0xfc(%rbp)
movl $0xffffffff, -0x108(%rbp) # imm = 0xFFFFFFFF
movl $0x0, -0x104(%rbp)
movq -0x108(%rbp), %rdi
leaq 0x19fde(%rip), %rsi     # 0x5411c
callq 0x2f540
movq %rax, %rsi
movq -0x30(%rbp), %rdx
movq -0x100(%rbp), %rdi
callq 0x2ff20
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x40(%rax)
leaq -0x171d(%rip), %rdi     # 0x38a50
leaq -0xe14(%rip), %rsi      # 0x39360
callq 0x48fe0
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x48(%rax)
movq -0x18(%rbp), %rax
movb $0x1, 0x73(%rax)
movq -0x18(%rbp), %rax
movb $0x1, 0x72(%rax)
movq -0x18(%rbp), %rax
movb $0x1, 0x71(%rax)
movq -0x18(%rbp), %rax
movb $0x1, 0x74(%rax)
movq -0x10(%rbp), %rdi
addq $0x30, %rdi
movq -0x10(%rbp), %rsi
addq $0x38, %rsi
movq -0x18(%rbp), %rdx
callq 0x48290
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x33970
addq $0x150, %rsp            # imm = 0x150
popq %rbp
retq
nopw %cs:(%rax,%rax)