#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 */

/* Variables and functions */
double DBL_DIG;
int /*<<< orphan*/ free(char *);
scalar_t__ malloc(int);
int /*<<< orphan*/ sprintf(char *, char *, int, double, double, double, double);
int /*<<< orphan*/ write_cluster_statistics_to_file(char const *, int const *,
                                                    int const *, int const *,
                                                    int, int, int, double,
                                                    unsigned int, int, char *);
void write_probability_sweep_cluster_statistics_to_file(
    const char *path, const int *cluster_sizes, const int *cluster_sizes_counts,
    const int *cluster_sizes_percolated, int cluster_sizes_total_count,
    int rows, int columns, double probability, unsigned int seed,
    int realizations, int grid_points, double probability_center,
    double decay) {
  char *other;
  other = (char *)malloc(140 * sizeof(char));
  sprintf(other,
          ";source:probability_sweep\n;grid_npoints:%d\n;grid_center:%.*e\n;"
          "grid_decay:%.*e\n",
          grid_points, DBL_DIG - 1, probability_center, DBL_DIG - 1, decay);
  write_cluster_statistics_to_file(path, cluster_sizes, cluster_sizes_counts,
                                   cluster_sizes_percolated,
                                   cluster_sizes_total_count, rows, columns,
                                   probability, seed, realizations, other);
  free(other);
}


x86 assembly (clang, -O0):
<write_probability_sweep_cluster_statistics_to_file>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
sub    $0x68,%rsp
mov    0x28(%rbp),%eax
mov    0x20(%rbp),%eax
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%eax
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8d,-0x2c(%rbp)
mov    %r9d,-0x30(%rbp)
movsd  %xmm0,-0x38(%rbp)
movsd  %xmm1,-0x40(%rbp)
movsd  %xmm2,-0x48(%rbp)
mov    $0x8c,%edi
call   1050 <malloc@plt>
mov    %rax,-0x50(%rbp)
mov    -0x50(%rbp),%rdi
mov    0x28(%rbp),%edx
mov    0x2e50(%rip),%rax
movsd  (%rax),%xmm0
movsd  0xe5c(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  -0x40(%rbp),%xmm1
mov    0x2e34(%rip),%rax
movsd  (%rax),%xmm2
movsd  0xe40(%rip),%xmm3
subsd  %xmm3,%xmm2
movsd  -0x48(%rbp),%xmm3
lea    0xe38(%rip),%rsi
call   1060 <sprintf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
mov    -0x2c(%rbp),%r8d
mov    -0x30(%rbp),%r9d
mov    0x10(%rbp),%ebx
movsd  -0x38(%rbp),%xmm0
mov    0x18(%rbp),%r11d
mov    0x20(%rbp),%r10d
mov    -0x50(%rbp),%rax
mov    %ebx,(%rsp)
mov    %r11d,0x8(%rsp)
mov    %r10d,0x10(%rsp)
mov    %rax,0x18(%rsp)
call   1040 <write_cluster_statistics_to_file@plt>
mov    -0x50(%rbp),%rdi
call   1030 <free@plt>
add    $0x68,%rsp
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_probability_sweep_cluster_statistics_to_file>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
movsd  %xmm2,0x10(%rsp)
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,0x28(%rsp)
mov    %r9d,0x4(%rsp)
mov    %r8d,(%rsp)
mov    %rcx,%r12
mov    %rdx,%r13
mov    %rsi,%rbp
mov    %rdi,%r14
mov    0x70(%rsp),%eax
mov    %rax,0x30(%rsp)
mov    0x78(%rsp),%eax
mov    %rax,0x20(%rsp)
mov    0x80(%rsp),%eax
mov    %rax,0x18(%rsp)
mov    0x88(%rsp),%r15d
mov    $0x8c,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    0x2e39(%rip),%rax
movsd  (%rax),%xmm0
addsd  0xe45(%rip),%xmm0
lea    0xe46(%rip),%rsi
mov    %rbx,%rdi
mov    %r15d,%edx
movsd  0x8(%rsp),%xmm1
movapd %xmm0,%xmm2
movsd  0x10(%rsp),%xmm3
call   1060 <sprintf@plt>
mov    %r14,%rdi
mov    %rbp,%rsi
mov    %r13,%rdx
mov    %r12,%rcx
mov    (%rsp),%r8d
mov    0x4(%rsp),%r9d
movsd  0x28(%rsp),%xmm0
push   %rbx
push   0x20(%rsp)
push   0x30(%rsp)
push   0x48(%rsp)
call   1040 <write_cluster_statistics_to_file@plt>
add    $0x20,%rsp
mov    %rbx,%rdi
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <free@plt>

LLVM IR (-O0):
@.str = [79 x i8] c";source:probability_sweep\0A;grid_npoints:%d\0A;grid_center:%.*e\0A;grid_decay:%.*e\0A\00"
@DBL_DIG = global double 0.000000e+00
define void @write_probability_sweep_cluster_statistics_to_file(i8* %0, i32* %1, i32* %2, i32* %3, i32 %4, i32 %5, i32 %6, double %7, i32 %8, i32 %9, i32 %10, double %11, double %12) {
%14 = alloca i8*
%15 = alloca i32*
%16 = alloca i32*
%17 = alloca i32*
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
%21 = alloca double
%22 = alloca i32
%23 = alloca i32
%24 = alloca i32
%25 = alloca double
%26 = alloca double
%27 = alloca i8*
store i8* %0, i8** %14
store i32* %1, i32** %15
store i32* %2, i32** %16
store i32* %3, i32** %17
store i32 %4, i32* %18
store i32 %5, i32* %19
store i32 %6, i32* %20
store double %7, double* %21
store i32 %8, i32* %22
store i32 %9, i32* %23
store i32 %10, i32* %24
store double %11, double* %25
store double %12, double* %26
%28 = call i64 @malloc(i32 140)
%29 = inttoptr i64 %28 to i8*
store i8* %29, i8** %27
%30 = load i8*, i8** %27
%31 = load i32, i32* %24
%32 = load double, double* @DBL_DIG
%33 = fsub double %32, 1.000000e+00
%34 = load double, double* %25
%35 = load double, double* @DBL_DIG
%36 = fsub double %35, 1.000000e+00
%37 = load double, double* %26
%38 = call i32 @sprintf(i8* %30, i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str, i64 0, i64 0), i32 %31, double %33, double %34, double %36, double %37)
%39 = load i8*, i8** %14
%40 = load i32*, i32** %15
%41 = load i32*, i32** %16
%42 = load i32*, i32** %17
%43 = load i32, i32* %18
%44 = load i32, i32* %19
%45 = load i32, i32* %20
%46 = load double, double* %21
%47 = load i32, i32* %22
%48 = load i32, i32* %23
%49 = load i8*, i8** %27
%50 = call i32 @write_cluster_statistics_to_file(i8* %39, i32* %40, i32* %41, i32* %42, i32 %43, i32 %44, i32 %45, double %46, i32 %47, i32 %48, i8* %49)
%51 = load i8*, i8** %27
%52 = call i32 @free(i8* %51)
ret void
}

LLVM IR (-O2):
@.str = [79 x i8] c";source:probability_sweep\0A;grid_npoints:%d\0A;grid_center:%.*e\0A;grid_decay:%.*e\0A\00"
@DBL_DIG = global double 0.000000e+00
define void @write_probability_sweep_cluster_statistics_to_file(i8* %0, i32* %1, i32* %2, i32* %3, i32 %4, i32 %5, i32 %6, double %7, i32 %8, i32 %9, i32 %10, double %11, double %12) {
%14 = tail call i64 @malloc(i32 140)
%15 = inttoptr i64 %14 to i8*
%16 = load double, double* @DBL_DIG
%17 = fadd double %16, -1.000000e+00
%18 = tail call i32 @sprintf(i8* dereferenceable(1) %15, i8* dereferenceable(1) getelementptr inbounds ([79 x i8], [79 x i8]* @.str, i64 0, i64 0), i32 %10, double %17, double %11, double %17, double %12)
%19 = tail call i32 @write_cluster_statistics_to_file(i8* %0, i32* %1, i32* %2, i32* %3, i32 %4, i32 %5, i32 %6, double %7, i32 %8, i32 %9, i8* %15)
%20 = tail call i32 @free(i8* %15)
ret void
}