// File: /workspace/github_c_makefile_star2_O2/mirth-lang[P]mirth/bin/mirth1.c
// Function: mw_std_output_zaOutput_put
static void mw_std_output_zaOutput_put (STR* in_Str_1, struct std_output_zaOutput* in_zaOutput_2, struct std_output_zaOutput* *out_zaOutput_3) {
	incref(MKSTR(in_Str_1));
	uint64_t v4 = str_size(in_Str_1);
	INT v5 = u64_to_int(v4);
	struct std_output_zaOutput* v6;
	INT v7 = mw_std_output_zaOutput_capacityzeremaining(in_zaOutput_2, &v6);
	bool v8 = int_lt(v7, v5);
	struct std_output_zaOutput* branch_zaOutput_9;
	if (v8) {
		struct std_output_zaOutput* v10;
		mw_std_output_zaOutput_flushzx(v6, &v10);
		incref(MKSTR(in_Str_1));
		uint64_t v11 = str_size(in_Str_1);
		INT v12 = u64_to_int(v11);
		struct std_output_zaOutput* v13;
		INT v14 = mw_std_output_zaOutput_capacityzetotal(v10, &v13);
		bool v15 = int_le(v14, v12);
		struct std_output_zaOutput* branch_zaOutput_16;
		if (v15) {
			incref(MKSTR(in_Str_1));
			incref(MKSTR(in_Str_1));
			void* v17 = str_base(in_Str_1);
			uint64_t v18 = str_size(in_Str_1);
			INT v19 = u64_to_int(v18);
			struct std_file_zaFile* r20 = v13->mzafile;
			struct std_file_zaFile* v21;
			struct std_result_Result_2 v22 = mw_std_prelude_unsafe_1_sp2(r20, v17, v19, &v21);
			v13->mzafile = v21;
			decref(MK_std_result_Result_2(v22));
			decref(MKSTR(in_Str_1));
			branch_zaOutput_16 = v13;
		} else {
			struct std_output_zaOutput* v23;
			mw_std_output_zaOutput_put(in_Str_1, v13, &v23);
			branch_zaOutput_16 = v23;
		}
		branch_zaOutput_9 = branch_zaOutput_16;
	} else {
		incref(MKSTR(in_Str_1));
		struct std_output_zaOutput* v24;
		INT v25 = mw_std_output_zaOutput_offset(v6, &v24);
		ARR* r26 = v24->mzabuffer;
		ARR* v27;
		mw_std_buffer_zaBuffer_strzx(r26, in_Str_1, v25, &v27);
		v24->mzabuffer = v27;
		uint64_t v28 = str_size(in_Str_1);
		INT v29 = u64_to_int(v28);
		INT v30 = v24->msizze;
		incref(MKINT(v30));
		INT v31 = int_add(v29, v30);
		INT v32 = v24->msizze;
		decref(MKINT(v32));
		v24->msizze = v31;
		branch_zaOutput_9 = v24;
	}
	*out_zaOutput_3 = branch_zaOutput_9;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdx, %r13
movq %rsi, %r12
movq %rdi, %r14
movabsq $0xfffffffffffc, %rax   # imm = 0xFFFFFFFFFFFC
movq %rdi, %rcx
andq %rax, %rcx
movq %rcx, -0x30(%rbp)
setne %al
testb $0x3, %r14b
sete %bl
andb %al, %bl
cmpb $0x1, %bl
jne 0x8a9c3
movq -0x30(%rbp), %rax
incl (%rax)
movq %r14, %rdi
callq 0xdb65
movq %rax, %rdi
callq 0xdbc8
movq %rax, %r15
leaq -0x48(%rbp), %rsi
movq %r12, %rdi
callq 0x8ac5f
movq %rax, %rdi
movq %r15, %rsi
callq 0x89cc
testb %al, %al
je 0x8aae8
movq -0x48(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x8acb2
testb %bl, %bl
je 0x8aa0c
movq -0x30(%rbp), %rax
incl (%rax)
movq %r14, %rdi
callq 0xdb65
movq %rax, %rdi
callq 0xdbc8
movq %rax, %r15
movq -0x50(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x8ad8a
movq %rax, %rdi
movq %r15, %rsi
callq 0xdfd4
testb %al, %al
je 0x8ac36
testb %bl, %bl
je 0x8aa4a
movq -0x30(%rbp), %rax
addl $0x2, (%rax)
movq %r14, %rdi
callq 0xdf99
movq %rax, %r15
movq %r14, %rdi
callq 0xdb65
movq %rax, %rdi
callq 0xdbc8
movq -0x38(%rbp), %rcx
movq 0x8(%rcx), %rdi
leaq -0x40(%rbp), %r12
movq %r15, %rsi
movq %rcx, %r15
movq %rax, %rdx
movq %r12, %rcx
callq 0x8adbf
movq (%r12), %rcx
movq %rcx, 0x8(%r15)
movabsq $0xfffffffffffc, %rdi   # imm = 0xFFFFFFFFFFFC
andq %rdx, %rdi
sete %cl
testb $0x3, %dl
setne %sil
orb %cl, %sil
jne 0x8aac0
decl (%rdi)
jne 0x8aac0
shlq $0x30, %rax
orq %rdx, %rax
leaq 0x7f1a1(%rip), %rsi     # 0x109c59
movq %rax, %rdi
callq 0xce94
testb %bl, %bl
je 0x8ac4c
movq -0x30(%rbp), %rax
decl (%rax)
jne 0x8ac4c
movq %r14, %rdi
leaq 0x7d67b(%rip), %rsi     # 0x108159
callq 0xce94
jmp 0x8ac4c
movq %r13, -0x60(%rbp)
testb %bl, %bl
je 0x8aaf6
movq -0x30(%rbp), %rax
incl (%rax)
movq -0x48(%rbp), %rdi
leaq -0x40(%rbp), %r15
movq %r15, %rsi
callq 0x8b114
movq %rax, %r13
movq (%r15), %rax
movq %rax, -0x58(%rbp)
movq 0x10(%rax), %r15
testb %bl, %bl
je 0x8ab1e
movq -0x30(%rbp), %rax
incl (%rax)
movq %r14, %rdi
callq 0xdb65
movq %rax, %rdi
callq 0xdbc8
leaq -0x50(%rbp), %r12
movq %r15, %rdi
movq %r13, %rsi
movq %rax, %rdx
movq %r12, %rcx
callq 0x111af
movq (%r12), %rdi
leaq -0x38(%rbp), %rsi
callq 0x10d9d
movq %rax, %r12
movq %r13, %rdi
callq 0xdc43
movq %rax, %r13
testb %bl, %bl
je 0x8ab69
movq -0x30(%rbp), %rax
addl $0x2, (%rax)
movq %r14, %rdi
callq 0xdf99
movq %rax, %r15
movq %r14, %rdi
callq 0xdb65
movq %rax, %rdi
callq 0xdbc8
movq %rax, %rdi
callq 0xdc43
testq %rax, %rax
je 0x8aba2
addq %r13, %r12
movq %r12, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x50e0
testb %bl, %bl
je 0x8abbd
movq -0x30(%rbp), %rax
decl (%rax)
jne 0x8abbd
movq %r14, %rdi
leaq 0x7d5a1(%rip), %rsi     # 0x108159
callq 0xce94
movq -0x38(%rbp), %rax
movq -0x58(%rbp), %r15
movq %rax, 0x10(%r15)
movq %r14, %rdi
callq 0xdb65
movq %rax, %rdi
callq 0xdbc8
movq (%r15), %rsi
movq %rsi, %rcx
movabsq $0xfffffffffffc, %rbx   # imm = 0xFFFFFFFFFFFC
andq %rbx, %rcx
sete %dl
testb $0x3, %sil
setne %dil
orb %dl, %dil
movq -0x60(%rbp), %r13
jne 0x8ac02
incl (%rcx)
movq %rax, %rdi
callq 0xdd03
movq %rax, %r14
movq (%r15), %rdi
andq %rdi, %rbx
sete %al
testb $0x3, %dil
setne %cl
orb %al, %cl
jne 0x8ac31
decl (%rbx)
jne 0x8ac31
leaq 0x7d7fd(%rip), %rsi     # 0x108429
callq 0xce94
movq %r14, (%r15)
jmp 0x8ac4c
movq -0x38(%rbp), %rsi
leaq -0x40(%rbp), %r15
movq %r14, %rdi
movq %r15, %rdx
callq 0x8a97e
movq (%r15), %r15
movq %r15, (%r13)
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq