// File: /workspace/github_c_makefile_star2_O1/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, -0x40(%rbp)
movq %rsi, %r15
movabsq $0xfffffffffffc, %r12   # imm = 0xFFFFFFFFFFFC
movq %rdi, %r13
andq %r12, %r13
setne %al
testb $0x3, %dil
sete %r14b
andb %al, %r14b
cmpb $0x1, %r14b
jne 0x94a35
incl (%r13)
movq %rdi, -0x30(%rbp)
callq 0xe740
movq %rax, %rdi
callq 0xe7a9
movq %rax, %rbx
leaq -0x58(%rbp), %rsi
movq %r15, %rdi
callq 0x94cef
movq %rax, %rdi
movq %rbx, %rsi
callq 0xec04
testl %eax, %eax
movq %r13, -0x38(%rbp)
js 0x94bc6
testb %r14b, %r14b
je 0x94a75
incl (%r13)
movq -0x58(%rbp), %r15
movq (%r15), %r13
movq %r13, %rax
andq %r12, %rax
sete %cl
testb $0x3, %r13b
setne %dl
orb %cl, %dl
jne 0x94a92
incl (%rax)
movq 0x10(%r15), %rbx
testb %r14b, %r14b
je 0x94aa1
movq -0x38(%rbp), %rax
incl (%rax)
movq -0x30(%rbp), %rdi
callq 0xe740
movq %rax, %rdi
callq 0xe7a9
leaq -0x50(%rbp), %r12
movq %rbx, %rdi
movq %r13, %rsi
movq %rax, %rdx
movq %r12, %rcx
callq 0x12085
movq (%r12), %rdi
leaq -0x48(%rbp), %rsi
callq 0x11c70
movq %rax, %r12
movq %r13, %rdi
callq 0xe818
movq %rax, -0x60(%rbp)
testb %r14b, %r14b
je 0x94aef
movq -0x38(%rbp), %rax
addl $0x2, (%rax)
movq -0x30(%rbp), %r13
movq %r13, %rdi
callq 0xebc3
movq %rax, %rbx
movq %r13, %rdi
callq 0xe740
movq %rax, %rdi
callq 0xe7a9
movq %rax, %rdi
callq 0xe818
testq %rax, %rax
je 0x94b2d
addq -0x60(%rbp), %r12
movq %r12, %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x50e0
testb %r14b, %r14b
movq -0x30(%rbp), %rbx
movq -0x38(%rbp), %rax
je 0x94b4d
decl (%rax)
jne 0x94b4d
movq %rbx, %rdi
leaq 0x80611(%rip), %rsi     # 0x115159
callq 0xd4e3
movq -0x48(%rbp), %rax
movq %rax, 0x10(%r15)
movq %rbx, %rdi
callq 0xe740
movq %rax, %rdi
callq 0xe7a9
movq (%r15), %rsi
movq %rsi, %rcx
movabsq $0xfffffffffffc, %r14   # imm = 0xFFFFFFFFFFFC
andq %r14, %rcx
sete %dl
testb $0x3, %sil
setne %dil
orb %dl, %dil
movq -0x40(%rbp), %r12
jne 0x94b8e
incl (%rcx)
movq %rax, %rdi
callq 0xe8e2
movq %rax, %rbx
movq (%r15), %rdi
andq %rdi, %r14
sete %al
testb $0x3, %dil
setne %cl
orb %al, %cl
jne 0x94bbe
decl (%r14)
jne 0x94bbe
leaq 0x80870(%rip), %rsi     # 0x115429
callq 0xd4e3
movq %rbx, (%r15)
jmp 0x94cdc
movq -0x58(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x94d4e
testb %r14b, %r14b
je 0x94bdc
incl (%r13)
movq -0x30(%rbp), %r13
movq %r13, %rdi
callq 0xe740
movq %rax, %rdi
callq 0xe7a9
movq %rax, %rbx
movq -0x48(%rbp), %r15
movq 0x10(%r15), %rdi
leaq -0x50(%rbp), %r12
movq %r12, %rsi
callq 0x12a76
movq (%r12), %rcx
movq %rcx, 0x10(%r15)
movq %rax, %rdi
movq %rbx, %rsi
callq 0xec04
testl %eax, %eax
jle 0x94c3c
leaq -0x50(%rbp), %rbx
movq %r13, %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x949f5
movq (%rbx), %r15
movq -0x40(%rbp), %r12
jmp 0x94cdc
testb %r14b, %r14b
movq -0x38(%rbp), %r13
je 0x94c4a
addl $0x2, (%r13)
movq -0x30(%rbp), %r12
movq %r12, %rdi
callq 0xebc3
movq %rax, %rbx
movq %r12, %rdi
callq 0xe740
movq %rax, %rdi
callq 0xe7a9
movq 0x8(%r15), %rdi
leaq -0x50(%rbp), %r12
movq %rbx, %rsi
movq %rax, %rdx
movq %r12, %rcx
callq 0x94e26
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 0x94cbd
decl (%rdi)
jne 0x94cbd
shlq $0x30, %rax
orq %rdx, %rax
leaq 0x81fa4(%rip), %rsi     # 0x116c59
movq %rax, %rdi
callq 0xd4e3
testb %r14b, %r14b
movq -0x40(%rbp), %r12
je 0x94cdc
decl (%r13)
jne 0x94cdc
movq -0x30(%rbp), %rdi
leaq 0x80482(%rip), %rsi     # 0x115159
callq 0xd4e3
movq %r15, (%r12)
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq