#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 */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ qd_to_string(double *, char *, int, int /*<<< orphan*/,
                                int /*<<< orphan*/, int /*<<< orphan*/, int,
                                char, int *);
int qd_write_pi(void) {
  char s[74];
  int s_end;
  const double qd_pi_0 = 3.141592653589793116e+00;
  const double qd_pi_1 = 1.224646799147353207e-16;
  const double qd_pi_2 = -2.994769809718339666e-33;
  const double qd_pi_3 = 1.112454220863365282e-49;
  double qd_pi[4];
  qd_pi[0] = qd_pi_0;
  qd_pi[1] = qd_pi_1;
  qd_pi[2] = qd_pi_2;
  qd_pi[3] = qd_pi_3;
  printf("writing Pi with quad double precision ...\n");
  qd_to_string(qd_pi, s, 64, 0, 0, 0, 1, ' ', &s_end);
  printf("Pi = %s\n", s);
  return 0;
}


x86 assembly (clang, -O0):
<qd_write_pi>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
movsd  0xee5(%rip),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  0xed0(%rip),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  0xebb(%rip),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  0xea6(%rip),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  0xeb1(%rip),%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  0xe99(%rip),%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movsd  0xe81(%rip),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  0xe69(%rip),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
lea    0xe7a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0xa0(%rbp),%rdi
lea    -0x50(%rbp),%rsi
mov    $0x40,%edx
xor    %r9d,%r9d
lea    -0x54(%rbp),%rax
mov    %r9d,%ecx
mov    %r9d,%r8d
movl   $0x1,(%rsp)
movl   $0x20,0x8(%rsp)
mov    %rax,0x10(%rsp)
call   1040 <qd_to_string@plt>
lea    -0x50(%rbp),%rsi
lea    0xe5d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0xc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<qd_write_pi>:
push   %rbx
sub    $0x80,%rsp
movaps 0xec1(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xec5(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
lea    0xed2(%rip),%rdi
call   1030 <puts@plt>
sub    $0x8,%rsp
lea    0x14(%rsp),%rax
lea    0x18(%rsp),%rdi
lea    0x38(%rsp),%rbx
mov    %rbx,%rsi
mov    $0x40,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
push   %rax
push   $0x20
push   $0x1
call   1050 <qd_to_string@plt>
add    $0x20,%rsp
lea    0xe8c(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [43 x i8] c"writing Pi with quad double precision ...\0A\00"
@.str.1 = [9 x i8] c"Pi = %s\0A\00"
define i32 @qd_write_pi() {
%1 = alloca [74 x i8]
%2 = alloca i32
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca [4 x double]
store double 0x400921FB54442D18, double* %3
store double 0x3CA1A62633145C07, double* %4
store double 0xB92F1976B7ED8FBC, double* %5
store double 0x35C4CF98E804177D, double* %6
%8 = getelementptr inbounds [4 x double], [4 x double]* %7, i64 0, i64 0
store double 0x400921FB54442D18, double* %8
%9 = getelementptr inbounds [4 x double], [4 x double]* %7, i64 0, i64 1
store double 0x3CA1A62633145C07, double* %9
%10 = getelementptr inbounds [4 x double], [4 x double]* %7, i64 0, i64 2
store double 0xB92F1976B7ED8FBC, double* %10
%11 = getelementptr inbounds [4 x double], [4 x double]* %7, i64 0, i64 3
store double 0x35C4CF98E804177D, double* %11
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
%13 = getelementptr inbounds [4 x double], [4 x double]* %7, i64 0, i64 0
%14 = getelementptr inbounds [74 x i8], [74 x i8]* %1, i64 0, i64 0
%15 = call i32 @qd_to_string(double* %13, i8* %14, i32 64, i32 0, i32 0, i32 0, i32 1, i8 signext 32, i32* %2)
%16 = getelementptr inbounds [74 x i8], [74 x i8]* %1, i64 0, i64 0
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* %16)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [9 x i8] c"Pi = %s\0A\00"
@str = [42 x i8] c"writing Pi with quad double precision ...\00"
define i32 @qd_write_pi() {
%1 = alloca [74 x i8]
%2 = alloca i32
%3 = alloca [4 x double]
%4 = getelementptr inbounds [74 x i8], [74 x i8]* %1, i64 0, i64 0
%5 = bitcast i32* %2 to i8*
%6 = bitcast [4 x double]* %3 to i8*
%7 = getelementptr inbounds [4 x double], [4 x double]* %3, i64 0, i64 0
%8 = bitcast [4 x double]* %3 to <2 x double>*
store <2 x double> <double 0x400921FB54442D18, double 0x3CA1A62633145C07>, <2 x double>* %8
%9 = getelementptr inbounds [4 x double], [4 x double]* %3, i64 0, i64 2
%10 = bitcast double* %9 to <2 x double>*
store <2 x double> <double 0xB92F1976B7ED8FBC, double 0x35C4CF98E804177D>, <2 x double>* %10
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str, i64 0, i64 0))
%12 = call i32 @qd_to_string(double* %7, i8* %4, i32 64, i32 0, i32 0, i32 0, i32 1, i8 signext 32, i32* %2)
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 0
}