// File: /workspace/github_c_makefile_star2_O1/mirth-lang[P]mirth/bin/mirth1.c
// Function: mw_mirth_mirth_zaMirth_emitzediagnosticzeatzx
static void mw_mirth_mirth_zaMirth_emitzediagnosticzeatzx (struct mirth_mirth_zaMirth* in_zaMirth_1, struct mirth_location_Location* in_Location_2, STR* in_Str_3, enum mirth_mirth_Severity in_Severity_4, struct mirth_mirth_zaMirth* *out_zaMirth_5) {
	struct mirth_mirth_zaMirth* branch_zaMirth_6;
	STR* branch_Str_7;
	struct mirth_location_Location* branch_Location_8;
	enum mirth_mirth_Severity branch_Severity_9;
	switch (in_Severity_4) {
		case mirth_mirth_Severity_Info: {
			branch_Severity_9 = in_Severity_4;
			branch_Location_8 = in_Location_2;
			branch_Str_7 = in_Str_3;
			branch_zaMirth_6 = in_zaMirth_1;
		} break;
		case mirth_mirth_Severity_Warning: {
			INT v10 = in_zaMirth_1->mnumzewarnings;
			incref(MKNAT(v10));
			INT v11 = WRAP_I63(1LL);
			INT v12 = v10;
			INT v13 = v11;
			INT v14 = int_add(v12, v13);
			INT v15 = v14;
			INT v16 = in_zaMirth_1->mnumzewarnings;
			decref(MKNAT(v16));
			in_zaMirth_1->mnumzewarnings = v15;
			branch_Severity_9 = in_Severity_4;
			branch_Location_8 = in_Location_2;
			branch_Str_7 = in_Str_3;
			branch_zaMirth_6 = in_zaMirth_1;
		} break;
		case mirth_mirth_Severity_Error: {
			INT v17 = in_zaMirth_1->mnumzeerrors;
			incref(MKNAT(v17));
			INT v18 = WRAP_I63(1LL);
			INT v19 = v17;
			INT v20 = v18;
			INT v21 = int_add(v19, v20);
			INT v22 = v21;
			INT v23 = in_zaMirth_1->mnumzeerrors;
			decref(MKNAT(v23));
			in_zaMirth_1->mnumzeerrors = v22;
			branch_Severity_9 = in_Severity_4;
			branch_Location_8 = in_Location_2;
			branch_Str_7 = in_Str_3;
			branch_zaMirth_6 = in_zaMirth_1;
		} break;
		default: {
			do_panic(str_make("unexpected fallthrough in match\n", 32));
		}
	}
	struct mirth_mirth_Diagnostic* v24 = mtw_mirth_mirth_Diagnostic_Diagnostic(branch_Severity_9, branch_Location_8, branch_Str_7);
	struct std_list_List_1 r25 = branch_zaMirth_6->mzadiagnostics;
	struct std_list_List_1 v26;
	mw_std_list_zaLister_1_pushzx(MK_mirth_mirth_Diagnostic(v24), r25, &v26);
	branch_zaMirth_6->mzadiagnostics = v26;
	*out_zaMirth_5 = branch_zaMirth_6;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r8, -0x30(%rbp)
movl %ecx, %r15d
movq %rdx, %r13
movq %rsi, %r12
movq %rdi, %r14
testl %ecx, %ecx
je 0x1c018
movabsq $0xfffffffffffc, %rbx   # imm = 0xFFFFFFFFFFFC
cmpl $0x2, %r15d
jne 0x1bfc5
movq (%r14), %rdi
movq %rdi, %rax
andq %rbx, %rax
sete %cl
testb $0x3, %dil
setne %dl
orb %cl, %dl
jne 0x1bf8c
incl (%rax)
movl $0x3, %esi
callq 0xe8e2
movq (%r14), %rdi
andq %rdi, %rbx
sete %dl
testb $0x3, %dil
setne %cl
orb %dl, %cl
jne 0x1bfc0
decl (%rbx)
jne 0x1bfc0
leaq 0xf915c(%rip), %rsi     # 0x115111
movq %rax, %rbx
callq 0xd4e3
movq %rbx, %rax
movq %rax, (%r14)
jmp 0x1c018
movq 0x8(%r14), %rdi
movq %rdi, %rax
andq %rbx, %rax
sete %cl
testb $0x3, %dil
setne %dl
orb %cl, %dl
jne 0x1bfdf
incl (%rax)
movl $0x3, %esi
callq 0xe8e2
movq 0x8(%r14), %rdi
andq %rdi, %rbx
sete %dl
testb $0x3, %dil
setne %cl
orb %dl, %cl
jne 0x1c014
decl (%rbx)
jne 0x1c014
leaq 0xf9108(%rip), %rsi     # 0x115111
movq %rax, %rbx
callq 0xd4e3
movq %rbx, %rax
movq %rax, 0x8(%r14)
movl $0x1, %edi
movl $0x18, %esi
callq 0x50c0
testq %rax, %rax
je 0x1c07a
movl $0x1, (%rax)
movq %r13, 0x10(%rax)
movq %r12, 0x8(%rax)
movl %r15d, 0x4(%rax)
movl 0x58(%r14), %edx
movq 0x60(%r14), %rcx
leaq 0xf997c(%rip), %rsi     # 0x1159c9
leaq -0x40(%rbp), %rbx
movq %rax, %rdi
movq %rbx, %r8
callq 0x9741
movups (%rbx), %xmm0
movups %xmm0, 0x58(%r14)
movq -0x30(%rbp), %rax
movq %r14, (%rax)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xcb551(%rip), %rsi     # 0xe75d2
movl $0x31, %edx
movl $0x2, %edi
callq 0x5060
callq 0x52be
movl $0x1, %edi
callq 0x5130