#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 fabs(double const);
int /*<<< orphan*/ memset(char *, char, int);
int /*<<< orphan*/ sprintf(char *, char const *, double);
int set_mpc_style_offsets(char *buff, const double *xyz) {
  double maxval = 0;
  int i;
  for (i = 0; i < 3; i++)
    if (maxval < fabs(xyz[i]))
      maxval = fabs(xyz[i]);
  memset(buff + 33, ' ', 39);
  buff[33] = ' ';
  if (maxval > 9999999.0) {
    buff[32] = '2';
    for (i = 0; i < 3; i++)
      sprintf(buff + 35 + i * 12,
              (maxval > 9.9 * 1.495978707e+8 ? "%11.8f" : "%11.9f"),
              fabs(xyz[i] / 1.495978707e+8));
  } else {
    const char *format;
    buff[32] = '1';
    if (maxval > 999999.0)
      format = "%11.3f";
    else if (maxval > 99999.0)
      format = "%11.4f";
    else
      format = "%11.5f";
    for (i = 0; i < 3; i++)
      sprintf(buff + 35 + i * 12, format, fabs(xyz[i]));
  }
  for (i = 0; i < 3; i++)
    buff[34 + i * 12] = (xyz[i] > 0. ? '+' : '-');
  buff[14] = 's';
  buff[70] = ' ';
  return (0);
}


x86 assembly (clang, -O0):
<set_mpc_style_offsets>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x3,-0x1c(%rbp)
jge    11a0 <set_mpc_style_offsets+0x80>
movsd  -0x18(%rbp),%xmm1
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movaps 0xece(%rip),%xmm2
pand   %xmm2,%xmm0
ucomisd %xmm1,%xmm0
jbe    118d <set_mpc_style_offsets+0x6d>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movaps 0xeac(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1192 <set_mpc_style_offsets+0x72>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    113f <set_mpc_style_offsets+0x1f>
mov    -0x8(%rbp),%rdi
add    $0x21,%rdi
mov    $0x20,%esi
mov    $0x27,%edx
call   1030 <memset@plt>
mov    -0x8(%rbp),%rax
movb   $0x20,0x21(%rax)
movsd  -0x18(%rbp),%xmm0
movsd  0xe34(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    125f <set_mpc_style_offsets+0x13f>
mov    -0x8(%rbp),%rax
movb   $0x32,0x20(%rax)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x3,-0x1c(%rbp)
jge    125a <set_mpc_style_offsets+0x13a>
mov    -0x8(%rbp),%rdi
add    $0x23,%rdi
imul   $0xc,-0x1c(%rbp),%eax
cltq
add    %rax,%rdi
movsd  -0x18(%rbp),%xmm0
movsd  0xe13(%rip),%xmm1
lea    0xe33(%rip),%rsi
lea    0xe25(%rip),%rax
ucomisd %xmm1,%xmm0
cmova  %rax,%rsi
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  0xde0(%rip),%xmm1
divsd  %xmm1,%xmm0
movaps 0xded(%rip),%xmm1
pand   %xmm1,%xmm0
call   1040 <sprintf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    11e5 <set_mpc_style_offsets+0xc5>
jmp    131b <set_mpc_style_offsets+0x1fb>
mov    -0x8(%rbp),%rax
movb   $0x31,0x20(%rax)
movsd  -0x18(%rbp),%xmm0
movsd  0xd94(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    128e <set_mpc_style_offsets+0x16e>
lea    0xdc9(%rip),%rax
mov    %rax,-0x28(%rbp)
jmp    12c5 <set_mpc_style_offsets+0x1a5>
movsd  -0x18(%rbp),%xmm0
movsd  0xd75(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    12b5 <set_mpc_style_offsets+0x195>
lea    0xda9(%rip),%rax
mov    %rax,-0x28(%rbp)
jmp    12c0 <set_mpc_style_offsets+0x1a0>
lea    0xda0(%rip),%rax
mov    %rax,-0x28(%rbp)
jmp    12c5 <set_mpc_style_offsets+0x1a5>
movl   $0x0,-0x1c(%rbp)
cmpl   $0x3,-0x1c(%rbp)
jge    1316 <set_mpc_style_offsets+0x1f6>
mov    -0x8(%rbp),%rdi
add    $0x23,%rdi
imul   $0xc,-0x1c(%rbp),%eax
cltq
add    %rax,%rdi
mov    -0x28(%rbp),%rsi
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movaps 0xd31(%rip),%xmm1
pand   %xmm1,%xmm0
call   1040 <sprintf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    12cc <set_mpc_style_offsets+0x1ac>
jmp    131b <set_mpc_style_offsets+0x1fb>
movl   $0x0,-0x1c(%rbp)
cmpl   $0x3,-0x1c(%rbp)
jge    136e <set_mpc_style_offsets+0x24e>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
xorps  %xmm1,%xmm1
mov    $0x2d,%eax
mov    $0x2b,%ecx
ucomisd %xmm1,%xmm0
cmova  %ecx,%eax
mov    %al,%dl
mov    -0x8(%rbp),%rax
imul   $0xc,-0x1c(%rbp),%ecx
add    $0x22,%ecx
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1322 <set_mpc_style_offsets+0x202>
mov    -0x8(%rbp),%rax
movb   $0x73,0xe(%rax)
mov    -0x8(%rbp),%rax
movb   $0x20,0x46(%rax)
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_mpc_style_offsets>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
movapd 0xec9(%rip),%xmm3
movsd  (%rsi),%xmm0
movsd  0x8(%rsi),%xmm1
movsd  0x10(%rsi),%xmm4
andpd  %xmm3,%xmm0
xorpd  %xmm2,%xmm2
maxsd  %xmm2,%xmm0
andpd  %xmm3,%xmm1
maxsd  %xmm0,%xmm1
andpd  %xmm3,%xmm4
maxsd  %xmm1,%xmm4
movapd %xmm4,(%rsp)
add    $0x21,%rdi
mov    $0x20,%esi
mov    $0x27,%edx
call   1030 <memset@plt>
movapd (%rsp),%xmm0
movb   $0x20,0x21(%rbx)
ucomisd 0xe86(%rip),%xmm0
jbe    1205 <set_mpc_style_offsets+0xe5>
movb   $0x32,0x20(%rbx)
lea    0x23(%rbx),%rdi
ucomisd 0xe8c(%rip),%xmm0
lea    0xe95(%rip),%rax
lea    0xe95(%rip),%r15
cmova  %rax,%r15
movsd  (%r14),%xmm0
divsd  0xe75(%rip),%xmm0
movapd 0xe3d(%rip),%xmm1
andpd  %xmm1,%xmm0
mov    %r15,%rsi
call   1040 <sprintf@plt>
lea    0x2f(%rbx),%rdi
movsd  0x8(%r14),%xmm0
divsd  0xe4f(%rip),%xmm0
andpd  0xe17(%rip),%xmm0
mov    %r15,%rsi
call   1040 <sprintf@plt>
lea    0x3b(%rbx),%rdi
movsd  0x10(%r14),%xmm0
divsd  0xe2d(%rip),%xmm0
jmp    1276 <set_mpc_style_offsets+0x156>
ucomisd 0xe0b(%rip),%xmm0
lea    0xe39(%rip),%rax
lea    0xe39(%rip),%rcx
cmova  %rax,%rcx
ucomisd 0xdf9(%rip),%xmm0
lea    0xe18(%rip),%r15
cmovbe %rcx,%r15
movb   $0x31,0x20(%rbx)
lea    0x23(%rbx),%rdi
movsd  (%r14),%xmm0
movapd 0xdb9(%rip),%xmm1
andpd  %xmm1,%xmm0
mov    %r15,%rsi
call   1040 <sprintf@plt>
lea    0x2f(%rbx),%rdi
movsd  0x8(%r14),%xmm0
andps  0xd9c(%rip),%xmm0
mov    %r15,%rsi
call   1040 <sprintf@plt>
lea    0x3b(%rbx),%rdi
movsd  0x10(%r14),%xmm0
andpd  0xd82(%rip),%xmm0
mov    %r15,%rsi
call   1040 <sprintf@plt>
movsd  (%r14),%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
setbe  %al
add    %al,%al
add    $0x2b,%al
mov    %al,0x22(%rbx)
movsd  0x8(%r14),%xmm0
ucomisd %xmm1,%xmm0
setbe  %al
add    %al,%al
add    $0x2b,%al
mov    %al,0x2e(%rbx)
movsd  0x10(%r14),%xmm0
ucomisd %xmm1,%xmm0
setbe  %al
add    %al,%al
add    $0x2b,%al
mov    %al,0x3a(%rbx)
movb   $0x73,0xe(%rbx)
movb   $0x20,0x46(%rbx)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%11.8f\00"
@.str.1 = [7 x i8] c"%11.9f\00"
@.str.2 = [7 x i8] c"%11.3f\00"
@.str.3 = [7 x i8] c"%11.4f\00"
@.str.4 = [7 x i8] c"%11.5f\00"
define i32 @set_mpc_style_offsets(i8* %0, double* %1) {
%3 = alloca i8*
%4 = alloca double*
%5 = alloca double
%6 = alloca i32
%7 = alloca i8*
store i8* %0, i8** %3
store double* %1, double** %4
store double 0.000000e+00, double* %5
store i32 0, i32* %6
br label %8
8: ; preds = %28, %2
%9 = load i32, i32* %6
%10 = icmp slt i32 %9, 3
br i1 %10, label %11, label %31
11: ; preds = %8
%12 = load double, double* %5
%13 = load double*, double** %4
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds double, double* %13, i64 %15
%17 = load double, double* %16
%18 = call double @llvm.fabs.f64(double %17)
%19 = fcmp olt double %12, %18
br i1 %19, label %20, label %27
20: ; preds = %11
%21 = load double*, double** %4
%22 = load i32, i32* %6
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds double, double* %21, i64 %23
%25 = load double, double* %24
%26 = call double @llvm.fabs.f64(double %25)
store double %26, double* %5
br label %27
27: ; preds = %20, %11
br label %28
28: ; preds = %27
%29 = load i32, i32* %6
%30 = add nsw i32 %29, 1
store i32 %30, i32* %6
br label %8
31: ; preds = %8
%32 = load i8*, i8** %3
%33 = getelementptr inbounds i8, i8* %32, i64 33
%34 = call i32 @memset(i8* %33, i8 signext 32, i32 39)
%35 = load i8*, i8** %3
%36 = getelementptr inbounds i8, i8* %35, i64 33
store i8 32, i8* %36
%37 = load double, double* %5
%38 = fcmp ogt double %37, 0x416312CFE0000000
br i1 %38, label %39, label %68
39: ; preds = %31
%40 = load i8*, i8** %3
%41 = getelementptr inbounds i8, i8* %40, i64 32
store i8 50, i8* %41
store i32 0, i32* %6
br label %42
42: ; preds = %64, %39
%43 = load i32, i32* %6
%44 = icmp slt i32 %43, 3
br i1 %44, label %45, label %67
45: ; preds = %42
%46 = load i8*, i8** %3
%47 = getelementptr inbounds i8, i8* %46, i64 35
%48 = load i32, i32* %6
%49 = mul nsw i32 %48, 12
%50 = sext i32 %49 to i64
%51 = getelementptr inbounds i8, i8* %47, i64 %50
%52 = load double, double* %5
%53 = fcmp ogt double %52, 0x41D611A389FB851E
%54 = zext i1 %53 to i64
%55 = select i1 %53, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0)
%56 = load double*, double** %4
%57 = load i32, i32* %6
%58 = sext i32 %57 to i64
%59 = getelementptr inbounds double, double* %56, i64 %58
%60 = load double, double* %59
%61 = fdiv double %60, 0x41A1D55D5D666666
%62 = call double @llvm.fabs.f64(double %61)
%63 = call i32 @sprintf(i8* %51, i8* %55, double %62)
br label %64
64: ; preds = %45
%65 = load i32, i32* %6
%66 = add nsw i32 %65, 1
store i32 %66, i32* %6
br label %42
67: ; preds = %42
br label %103
68: ; preds = %31
%69 = load i8*, i8** %3
%70 = getelementptr inbounds i8, i8* %69, i64 32
store i8 49, i8* %70
%71 = load double, double* %5
%72 = fcmp ogt double %71, 9.999990e+05
br i1 %72, label %73, label %74
73: ; preds = %68
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8** %7
br label %80
74: ; preds = %68
%75 = load double, double* %5
%76 = fcmp ogt double %75, 9.999900e+04
br i1 %76, label %77, label %78
77: ; preds = %74
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i8** %7
br label %79
78: ; preds = %74
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i8** %7
br label %79
79: ; preds = %78, %77
br label %80
80: ; preds = %79, %73
store i32 0, i32* %6
br label %81
81: ; preds = %99, %80
%82 = load i32, i32* %6
%83 = icmp slt i32 %82, 3
br i1 %83, label %84, label %102
84: ; preds = %81
%85 = load i8*, i8** %3
%86 = getelementptr inbounds i8, i8* %85, i64 35
%87 = load i32, i32* %6
%88 = mul nsw i32 %87, 12
%89 = sext i32 %88 to i64
%90 = getelementptr inbounds i8, i8* %86, i64 %89
%91 = load i8*, i8** %7
%92 = load double*, double** %4
%93 = load i32, i32* %6
%94 = sext i32 %93 to i64
%95 = getelementptr inbounds double, double* %92, i64 %94
%96 = load double, double* %95
%97 = call double @llvm.fabs.f64(double %96)
%98 = call i32 @sprintf(i8* %90, i8* %91, double %97)
br label %99
99: ; preds = %84
%100 = load i32, i32* %6
%101 = add nsw i32 %100, 1
store i32 %101, i32* %6
br label %81
102: ; preds = %81
br label %103
103: ; preds = %102, %67
store i32 0, i32* %6
br label %104
104: ; preds = %123, %103
%105 = load i32, i32* %6
%106 = icmp slt i32 %105, 3
br i1 %106, label %107, label %126
107: ; preds = %104
%108 = load double*, double** %4
%109 = load i32, i32* %6
%110 = sext i32 %109 to i64
%111 = getelementptr inbounds double, double* %108, i64 %110
%112 = load double, double* %111
%113 = fcmp ogt double %112, 0.000000e+00
%114 = zext i1 %113 to i64
%115 = select i1 %113, i32 43, i32 45
%116 = trunc i32 %115 to i8
%117 = load i8*, i8** %3
%118 = load i32, i32* %6
%119 = mul nsw i32 %118, 12
%120 = add nsw i32 34, %119
%121 = sext i32 %120 to i64
%122 = getelementptr inbounds i8, i8* %117, i64 %121
store i8 %116, i8* %122
br label %123
123: ; preds = %107
%124 = load i32, i32* %6
%125 = add nsw i32 %124, 1
store i32 %125, i32* %6
br label %104
126: ; preds = %104
%127 = load i8*, i8** %3
%128 = getelementptr inbounds i8, i8* %127, i64 14
store i8 115, i8* %128
%129 = load i8*, i8** %3
%130 = getelementptr inbounds i8, i8* %129, i64 70
store i8 32, i8* %130
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"%11.8f\00"
@.str.1 = [7 x i8] c"%11.9f\00"
@.str.2 = [7 x i8] c"%11.3f\00"
@.str.3 = [7 x i8] c"%11.4f\00"
@.str.4 = [7 x i8] c"%11.5f\00"
define i32 @set_mpc_style_offsets(i8* %0, double* nocapture %1) {
%3 = load double, double* %1
%4 = tail call double @llvm.fabs.f64(double %3)
%5 = fcmp ogt double %4, 0.000000e+00
%6 = select i1 %5, double %4, double 0.000000e+00
%7 = getelementptr inbounds double, double* %1, i64 1
%8 = load double, double* %7
%9 = tail call double @llvm.fabs.f64(double %8)
%10 = fcmp olt double %6, %9
%11 = select i1 %10, double %9, double %6
%12 = getelementptr inbounds double, double* %1, i64 2
%13 = load double, double* %12
%14 = tail call double @llvm.fabs.f64(double %13)
%15 = fcmp olt double %11, %14
%16 = select i1 %15, double %14, double %11
%17 = getelementptr inbounds i8, i8* %0, i64 33
%18 = tail call i32 @memset(i8* %17, i8 signext 32, i32 39)
store i8 32, i8* %17
%19 = fcmp ogt double %16, 0x416312CFE0000000
%20 = getelementptr inbounds i8, i8* %0, i64 32
br i1 %19, label %21, label %39
21: ; preds = %2
store i8 50, i8* %20
%22 = getelementptr inbounds i8, i8* %0, i64 35
%23 = fcmp ogt double %16, 0x41D611A389FB851E
%24 = select i1 %23, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0)
%25 = load double, double* %1
%26 = fdiv double %25, 0x41A1D55D5D666666
%27 = tail call double @llvm.fabs.f64(double %26)
%28 = tail call i32 @sprintf(i8* %22, i8* dereferenceable(1) %24, double %27)
%29 = getelementptr inbounds i8, i8* %0, i64 47
%30 = load double, double* %7
%31 = fdiv double %30, 0x41A1D55D5D666666
%32 = tail call double @llvm.fabs.f64(double %31)
%33 = tail call i32 @sprintf(i8* %29, i8* dereferenceable(1) %24, double %32)
%34 = getelementptr inbounds i8, i8* %0, i64 59
%35 = load double, double* %12
%36 = fdiv double %35, 0x41A1D55D5D666666
%37 = tail call double @llvm.fabs.f64(double %36)
%38 = tail call i32 @sprintf(i8* %34, i8* dereferenceable(1) %24, double %37)
br label %56
39: ; preds = %2
store i8 49, i8* %20
%40 = fcmp ogt double %16, 9.999990e+05
%41 = fcmp ogt double %16, 9.999900e+04
%42 = select i1 %41, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0)
%43 = select i1 %40, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* %42
%44 = getelementptr inbounds i8, i8* %0, i64 35
%45 = load double, double* %1
%46 = tail call double @llvm.fabs.f64(double %45)
%47 = tail call i32 @sprintf(i8* %44, i8* dereferenceable(1) %43, double %46)
%48 = getelementptr inbounds i8, i8* %0, i64 47
%49 = load double, double* %7
%50 = tail call double @llvm.fabs.f64(double %49)
%51 = tail call i32 @sprintf(i8* %48, i8* dereferenceable(1) %43, double %50)
%52 = getelementptr inbounds i8, i8* %0, i64 59
%53 = load double, double* %12
%54 = tail call double @llvm.fabs.f64(double %53)
%55 = tail call i32 @sprintf(i8* %52, i8* dereferenceable(1) %43, double %54)
br label %56
56: ; preds = %39, %21
%57 = load double, double* %1
%58 = fcmp ogt double %57, 0.000000e+00
%59 = select i1 %58, i8 43, i8 45
%60 = getelementptr inbounds i8, i8* %0, i64 34
store i8 %59, i8* %60
%61 = load double, double* %7
%62 = fcmp ogt double %61, 0.000000e+00
%63 = select i1 %62, i8 43, i8 45
%64 = getelementptr inbounds i8, i8* %0, i64 46
store i8 %63, i8* %64
%65 = load double, double* %12
%66 = fcmp ogt double %65, 0.000000e+00
%67 = select i1 %66, i8 43, i8 45
%68 = getelementptr inbounds i8, i8* %0, i64 58
store i8 %67, i8* %68
%69 = getelementptr inbounds i8, i8* %0, i64 14
store i8 115, i8* %69
%70 = getelementptr inbounds i8, i8* %0, i64 70
store i8 32, i8* %70
ret i32 0
}