#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen_write(char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, double);
void write_summary_results_snmf(char *output_file_summary, double like,
                                double all_ce, double masked_ce) {
  FILE *m_File = NULL;
  m_File = fopen_write(output_file_summary);
  fprintf(m_File, "Least-square error: %f\n", like);
  fprintf(m_File, "Cross-Entropy (all data): %f\n", all_ce);
  fprintf(m_File, "Cross-Entropy (masked data): %f\n", masked_ce);
  fclose(m_File);
}


x86 assembly (clang, -O0):
<write_summary_results_snmf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <fopen_write@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
movsd  -0x10(%rbp),%xmm0
lea    0xe90(%rip),%rsi
call   1050 <fprintf@plt>
mov    -0x28(%rbp),%rdi
movsd  -0x18(%rbp),%xmm0
lea    0xe93(%rip),%rsi
call   1050 <fprintf@plt>
mov    -0x28(%rbp),%rdi
movsd  -0x20(%rbp),%xmm0
lea    0xe9c(%rip),%rsi
call   1050 <fprintf@plt>
mov    -0x28(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_summary_results_snmf>:
push   %rbx
sub    $0x20,%rsp
movsd  %xmm2,0x18(%rsp)
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
call   1040 <fopen_write@plt>
mov    %rax,%rbx
lea    0xeaa(%rip),%rsi
mov    %rax,%rdi
movsd  0x8(%rsp),%xmm0
call   1050 <fprintf@plt>
lea    0xead(%rip),%rsi
mov    %rbx,%rdi
movsd  0x10(%rsp),%xmm0
call   1050 <fprintf@plt>
lea    0xeb6(%rip),%rsi
mov    %rbx,%rdi
movsd  0x18(%rsp),%xmm0
call   1050 <fprintf@plt>
mov    %rbx,%rdi
add    $0x20,%rsp
pop    %rbx
jmp    1030 <fclose@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"Least-square error: %f\0A\00"
@.str.1 = [30 x i8] c"Cross-Entropy (all data): %f\0A\00"
@.str.2 = [33 x i8] c"Cross-Entropy (masked data): %f\0A\00"
define void @write_summary_results_snmf(i8* %0, double %1, double %2, double %3) {
%5 = alloca i8*
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca i32*
store i8* %0, i8** %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
store i32* null, i32** %9
%10 = load i8*, i8** %5
%11 = call i32* @fopen_write(i8* %10)
store i32* %11, i32** %9
%12 = load i32*, i32** %9
%13 = load double, double* %6
%14 = call i32 @fprintf(i32* %12, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), double %13)
%15 = load i32*, i32** %9
%16 = load double, double* %7
%17 = call i32 @fprintf(i32* %15, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), double %16)
%18 = load i32*, i32** %9
%19 = load double, double* %8
%20 = call i32 @fprintf(i32* %18, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0), double %19)
%21 = load i32*, i32** %9
%22 = call i32 @fclose(i32* %21)
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"Least-square error: %f\0A\00"
@.str.1 = [30 x i8] c"Cross-Entropy (all data): %f\0A\00"
@.str.2 = [33 x i8] c"Cross-Entropy (masked data): %f\0A\00"
define void @write_summary_results_snmf(i8* %0, double %1, double %2, double %3) {
%5 = tail call i32* @fopen_write(i8* %0)
%6 = tail call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), double %1)
%7 = tail call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), double %2)
%8 = tail call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0), double %3)
%9 = tail call i32 @fclose(i32* %5)
ret void
}