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

/* Variables and functions */
int fillArrayWith(int /*<<< orphan*/ *, size_t const, int /*<<< orphan*/);
int /*<<< orphan*/ m_clear(int /*<<< orphan*/);
int /*<<< orphan*/ m_init2(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ mpfr_get_default_rounding_mode();
int /*<<< orphan*/ mpfr_get_prec(int /*<<< orphan*/);
int /*<<< orphan*/ mpfr_set_d(int /*<<< orphan*/, double, int /*<<< orphan*/);
int fillArrayWithZeros(mpfr_t *array, const size_t size) {
  int err = 0;
  mpfr_t zero;
  m_init2(zero, mpfr_get_prec(array[0]));
  mpfr_set_d(zero, 0.0, mpfr_get_default_rounding_mode());
  err = fillArrayWith(array, size, zero);
  m_clear(zero);
  return err;
}


x86 assembly (clang, -O0):
<fillArrayWithZeros>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
call   1060 <mpfr_get_prec@plt>
mov    -0x20(%rbp),%edi
mov    %eax,%esi
call   1080 <m_init2@plt>
mov    -0x18(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    $0x0,%al
call   1030 <mpfr_get_default_rounding_mode@plt>
mov    -0x1c(%rbp),%edi
mov    %eax,%esi
xorps  %xmm0,%xmm0
call   1050 <mpfr_set_d@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%edx
call   1040 <fillArrayWith@plt>
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%edi
call   1070 <m_clear@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fillArrayWithZeros>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    (%rdi),%edi
call   1060 <mpfr_get_prec@plt>
mov    %eax,%esi
call   1080 <m_init2@plt>
xor    %eax,%eax
call   1030 <mpfr_get_default_rounding_mode@plt>
xorps  %xmm0,%xmm0
mov    %eax,%esi
call   1050 <mpfr_set_d@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <fillArrayWith@plt>
mov    %eax,%ebx
call   1070 <m_clear@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @fillArrayWithZeros(i32* %0, i64 %1) {
%3 = alloca i32*
%4 = alloca i64
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %3
store i64 %1, i64* %4
store i32 0, i32* %5
%7 = load i32, i32* %6
%8 = load i32*, i32** %3
%9 = getelementptr inbounds i32, i32* %8, i64 0
%10 = load i32, i32* %9
%11 = call i32 @mpfr_get_prec(i32 %10)
%12 = call i32 @m_init2(i32 %7, i32 %11)
%13 = load i32, i32* %6
%14 = call i32 (...) @mpfr_get_default_rounding_mode()
%15 = call i32 @mpfr_set_d(i32 %13, double 0.000000e+00, i32 %14)
%16 = load i32*, i32** %3
%17 = load i64, i64* %4
%18 = load i32, i32* %6
%19 = call i32 @fillArrayWith(i32* %16, i64 %17, i32 %18)
store i32 %19, i32* %5
%20 = load i32, i32* %6
%21 = call i32 @m_clear(i32 %20)
%22 = load i32, i32* %5
ret i32 %22
}

LLVM IR (-O2):
define i32 @fillArrayWithZeros(i32* %0, i64 %1) {
%3 = load i32, i32* %0
%4 = tail call i32 @mpfr_get_prec(i32 %3)
%5 = tail call i32 @m_init2(i32 undef, i32 %4)
%6 = tail call i32 (...) @mpfr_get_default_rounding_mode()
%7 = tail call i32 @mpfr_set_d(i32 undef, double 0.000000e+00, i32 %6)
%8 = tail call i32 @fillArrayWith(i32* %0, i64 %1, i32 undef)
%9 = tail call i32 @m_clear(i32 undef)
ret i32 %8
}