// File: /workspace/github_c_makefile_star2_O2/mirth-lang[P]mirth/bin/mirth1.c
// Function: mw_mirth_elab_elabzeexpandzetensorzx
static struct mirth_type_StackType mw_mirth_elab_elabzeexpandzetensorzx (struct mirth_mirth_zaMirth* in_zaMirth_1, struct mirth_type_StackType in_StackType_2, uint64_t in_Token_3, struct mirth_mirth_zaMirth* *out_zaMirth_4, struct mirth_type_Type *out_Type_6, uint64_t *out_Token_7) {
	struct mirth_mirth_zaMirth* v8;
	struct std_maybe_Maybe_1 v9 = mw_mirth_type_StackType_forcezeconszyzx(in_zaMirth_1, in_StackType_2, &v8);
	struct mirth_mirth_zaMirth* branch_zaMirth_10;
	struct mirth_type_StackType branch_StackType_11;
	struct mirth_type_Type branch_Type_12;
	uint64_t branch_Token_13;
	switch ((v9).tag) {
		case std_maybe_Maybe_1_Some: {
			VAL v14 = mtp_std_maybe_Maybe_1_Some(v9);
			VAL v15 = ((TUP*)PTRPTR(value_tup(v14)))->cells[0];
			VAL v16 = ((TUP*)PTRPTR(value_tup(v14)))->cells[1];
			tup_decref_outer(value_tup(v14));
			branch_Token_13 = in_Token_3;
			branch_Type_12 = V_mirth_type_Type(v16);
			branch_StackType_11 = V_mirth_type_StackType(v15);
			branch_zaMirth_10 = v8;
		} break;
		case std_maybe_Maybe_1_None: {
			struct mirth_type_StackType v17 = { .tag=mirth_type_StackType_Error };
			struct mirth_type_Type v18 = { .tag=mirth_type_Type_Error };
			STR* v19;
			STRLIT(v19, "expected tuple type", 19);
			struct mirth_mirth_zaMirth* v20;
			mw_mirth_mirth_zaMirth_emitzeerrorzx(v8, in_Token_3, v19, &v20);
			branch_Token_13 = in_Token_3;
			branch_Type_12 = v18;
			branch_StackType_11 = v17;
			branch_zaMirth_10 = v20;
		} break;
		default: {
			do_panic(str_make("unexpected fallthrough in match\n", 32));
		}
	}
	*out_Token_7 = branch_Token_13;
	*out_Type_6 = branch_Type_12;
	*out_zaMirth_4 = branch_zaMirth_10;
	return branch_StackType_11;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %r9, %r14
movq %r8, %r13
movq %rcx, %r15
leaq -0x30(%rbp), %rcx
callq 0x3896d
testl %eax, %eax
je 0x3e88a
movq %r15, -0x38(%rbp)
movq %r13, -0x40(%rbp)
cmpl $0x1, %eax
jne 0x3e919
movq %rdx, %rdi
callq 0xd491
movq %rax, %r13
movq %rdx, %rbx
movq %rax, %rdi
movq %rdx, %rsi
callq 0x8a95
movabsq $0xfffffffffffc, %rax   # imm = 0xFFFFFFFFFFFC
movq %r13, %r15
andq %rax, %r15
movq 0x8(%r15), %r12
movq %r13, %rdi
movq %rbx, %rsi
callq 0x8a95
movq 0x18(%r15), %r15
movq %r13, %rdi
movq %rbx, %rsi
callq 0x8a95
movq %r13, %rdi
callq 0x8ae0
movq %r15, %rcx
shrq $0x30, %rcx
movabsq $0xfffffffffffc, %rdx   # imm = 0xFFFFFFFFFFFC
andq %rdx, %r15
movq %r12, %rax
shrq $0x30, %rax
andq %rdx, %r12
movq -0x30(%rbp), %rdx
movq -0x40(%rbp), %r13
movq -0x38(%rbp), %rdi
jmp 0x3e8f0
movq 0x10ce167(%rip), %rdx   # 0x110c9f8
testq %rdx, %rdx
jne 0x3e8af
leaq 0x9afa2(%rip), %rdi     # 0xd983f
pushq $0x13
popq %rsi
callq 0x8a21
movq %rax, %rdx
movq %rax, 0x10ce149(%rip)   # 0x110c9f8
movabsq $0xfffffffffffc, %rax   # imm = 0xFFFFFFFFFFFC
andq %rdx, %rax
sete %cl
testb $0x3, %dl
setne %sil
orb %cl, %sil
jne 0x3e8cd
incl (%rax)
movq -0x30(%rbp), %rdi
leaq -0x48(%rbp), %rbx
movq %r15, %rsi
movq %rbx, %rcx
callq 0x2ceb4
movq (%rbx), %rdx
xorl %ecx, %ecx
movq %r15, %rdi
xorl %r15d, %r15d
xorl %eax, %eax
xorl %r12d, %r12d
movq 0x10(%rbp), %rsi
movq %rdi, (%rsi)
movl %ecx, (%r14)
andl $0x0, 0x4(%r14)
movq %r15, 0x8(%r14)
movq %rdx, (%r13)
movq %r12, %rdx
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x95eed(%rip), %rdi     # 0xd480d
pushq $0x20
popq %rsi
callq 0x8a21
movq %rax, %rdi
callq 0x8cc6