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

/* Variables and functions */
double M_PI;
void gauss_first_guess(long trunc, double *vals) {
  long i = 0;
  double gvals[] = {
      2.4048255577E0,   5.5200781103E0,   8.6537279129E0,   11.7915344391E0,
      14.9309177086E0,  18.0710639679E0,  21.2116366299E0,  24.3524715308E0,
      27.4934791320E0,  30.6346064684E0,  33.7758202136E0,  36.9170983537E0,
      40.0584257646E0,  43.1997917132E0,  46.3411883717E0,  49.4826098974E0,
      52.6240518411E0,  55.7655107550E0,  58.9069839261E0,  62.0484691902E0,
      65.1899648002E0,  68.3314693299E0,  71.4729816036E0,  74.6145006437E0,
      77.7560256304E0,  80.8975558711E0,  84.0390907769E0,  87.1806298436E0,
      90.3221726372E0,  93.4637187819E0,  96.6052679510E0,  99.7468198587E0,
      102.8883742542E0, 106.0299309165E0, 109.1714896498E0, 112.3130502805E0,
      115.4546126537E0, 118.5961766309E0, 121.7377420880E0, 124.8793089132E0,
      128.0208770059E0, 131.1624462752E0, 134.3040166383E0, 137.4455880203E0,
      140.5871603528E0, 143.7287335737E0, 146.8703076258E0, 150.0118824570E0,
      153.1534580192E0, 156.2950342685E0,
  };
  for (i = 0; i < trunc; i++) {
    if (i < (sizeof(gvals) / sizeof(gvals[0])))
      vals[i] = gvals[i];
    else
      vals[i] = vals[i - 1] + M_PI;
  }
}


x86 assembly (clang, -O0):
<gauss_first_guess>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1b0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
lea    -0x1b0(%rbp),%rdi
lea    0xec7(%rip),%rsi
mov    $0x190,%edx
call   1030 <memcpy@plt>
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x8(%rbp),%rax
jge    11c2 <gauss_first_guess+0xb2>
cmpq   $0x32,-0x18(%rbp)
jae    1183 <gauss_first_guess+0x73>
mov    -0x18(%rbp),%rax
movsd  -0x1b0(%rbp,%rax,8),%xmm0
ff ff
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
jmp    11ac <gauss_first_guess+0x9c>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
sub    $0x1,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    0x2e4d(%rip),%rax
addsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
jmp    11b1 <gauss_first_guess+0xa1>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    114b <gauss_first_guess+0x3b>
add    $0x1b0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gauss_first_guess>:
test   %rdi,%rdi
jle    11b6 <gauss_first_guess+0xb6>
cmp    $0x1,%rdi
jne    1132 <gauss_first_guess+0x32>
xor    %eax,%eax
test   $0x1,%dil
je     11b6 <gauss_first_guess+0xb6>
cmp    $0x32,%rax
jae    11a0 <gauss_first_guess+0xa0>
lea    0xed8(%rip),%rcx
movsd  (%rcx,%rax,8),%xmm0
jmp    11b1 <gauss_first_guess+0xb1>
mov    %rdi,%rcx
and    $0xfffffffffffffffe,%rcx
xor    %eax,%eax
lea    0xebe(%rip),%r8
mov    0x2e9f(%rip),%rdx
jmp    1166 <gauss_first_guess+0x66>
nopl   0x0(%rax,%rax,1)
movsd  0x8(%r8,%rax,8),%xmm0
movsd  %xmm0,0x8(%rsi,%rax,8)
add    $0x2,%rax
cmp    %rax,%rcx
je     1111 <gauss_first_guess+0x11>
cmp    $0x31,%rax
ja     1180 <gauss_first_guess+0x80>
movsd  (%r8,%rax,8),%xmm0
jmp    118a <gauss_first_guess+0x8a>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsd  -0x8(%rsi,%rax,8),%xmm0
addsd  (%rdx),%xmm0
movsd  %xmm0,(%rsi,%rax,8)
cmp    $0x31,%rax
jb     1150 <gauss_first_guess+0x50>
movsd  (%rsi,%rax,8),%xmm0
addsd  (%rdx),%xmm0
jmp    1157 <gauss_first_guess+0x57>
movsd  -0x8(%rsi,%rax,8),%xmm0
mov    0x2e3b(%rip),%rcx
addsd  (%rcx),%xmm0
movsd  %xmm0,(%rsi,%rax,8)
ret

LLVM IR (-O0):
@__const.gauss_first_guess.gvals = [50 x double] [double 0x40033D152E97406F, double 0x4016148F5B2C6A7A, double 0x40214EB56CCCC693, double 0x4027954400832F35, double 0x402DDCA13EF36894, double 0x403212313F8A0DF3, double 0x4035362DD1740E60, double 0x40385A3B93018E9B, double 0x403B7E54A5FD32CF, double 0x403EA27591CB9BAA, double 0x4040E34E13A67E6E, double 0x404275637A962DB0, double 0x4044077A7ED619B4, double 0x40459992C65D1A58, double 0x40472BAC0F811D0E, double 0x4048BDC6293F078B, double 0x404A4FE0EE44443C, double 0x404BE1FC41A4BB0B, double 0x404D74180C9E4C70, double 0x404F06343D0962E5, double 0x40504C28621F1003, double 0x40511536CB22E30B, double 0x4051DE4554A1C496, double 0x4052A753FA8203FF, double 0x40537062B953605F, double 0x405439718E2E2D44, double 0x40550280769A1716, double 0x4055CB8F7079BC64, double 0x4056949E79FB1C2A, double 0x40575DAD918AB34B, double 0x405826BCB5C9B72A, double 0x4058EFCBE58547AB, double 0x4059B8DB1FB0196F, double 0x405A81EA635CE070, double 0x405B4AF9AFB95F95, double 0x405C1409040B3012, double 0x405CDD185FABFF50, double 0x405DA627C20716B8, double 0x405E6F372A9735F0, double 0x405F384698E4519F, double 0x406000AB06413286, double 0x40606532C287EAEA, double 0x4060C9BA8119DE07, double 0x40612E4241CED5B1, double 0x406192CA04821915, double 0x4061F751C912513D, double 0x40625BD98F60C8A7, double 0x4062C061575186C2, double 0x406324E920CAB8BC, double 0x40638970EBB4CD04]
@M_PI = global double 0.000000e+00
define void @gauss_first_guess(i64 %0, double* %1) {
%3 = alloca i64
%4 = alloca double*
%5 = alloca i64
%6 = alloca [50 x double]
store i64 %0, i64* %3
store double* %1, double** %4
store i64 0, i64* %5
%7 = bitcast [50 x double]* %6 to i8*
store i64 0, i64* %5
br label %8
8: ; preds = %34, %2
%9 = load i64, i64* %5
%10 = load i64, i64* %3
%11 = icmp slt i64 %9, %10
br i1 %11, label %12, label %37
12: ; preds = %8
%13 = load i64, i64* %5
%14 = icmp ult i64 %13, 50
br i1 %14, label %15, label %22
15: ; preds = %12
%16 = load i64, i64* %5
%17 = getelementptr inbounds [50 x double], [50 x double]* %6, i64 0, i64 %16
%18 = load double, double* %17
%19 = load double*, double** %4
%20 = load i64, i64* %5
%21 = getelementptr inbounds double, double* %19, i64 %20
store double %18, double* %21
br label %33
22: ; preds = %12
%23 = load double*, double** %4
%24 = load i64, i64* %5
%25 = sub nsw i64 %24, 1
%26 = getelementptr inbounds double, double* %23, i64 %25
%27 = load double, double* %26
%28 = load double, double* @M_PI
%29 = fadd double %27, %28
%30 = load double*, double** %4
%31 = load i64, i64* %5
%32 = getelementptr inbounds double, double* %30, i64 %31
store double %29, double* %32
br label %33
33: ; preds = %22, %15
br label %34
34: ; preds = %33
%35 = load i64, i64* %5
%36 = add nsw i64 %35, 1
store i64 %36, i64* %5
br label %8
37: ; preds = %8
ret void
}

LLVM IR (-O2):
@__const.gauss_first_guess.gvals = [50 x double] [double 0x40033D152E97406F, double 0x4016148F5B2C6A7A, double 0x40214EB56CCCC693, double 0x4027954400832F35, double 0x402DDCA13EF36894, double 0x403212313F8A0DF3, double 0x4035362DD1740E60, double 0x40385A3B93018E9B, double 0x403B7E54A5FD32CF, double 0x403EA27591CB9BAA, double 0x4040E34E13A67E6E, double 0x404275637A962DB0, double 0x4044077A7ED619B4, double 0x40459992C65D1A58, double 0x40472BAC0F811D0E, double 0x4048BDC6293F078B, double 0x404A4FE0EE44443C, double 0x404BE1FC41A4BB0B, double 0x404D74180C9E4C70, double 0x404F06343D0962E5, double 0x40504C28621F1003, double 0x40511536CB22E30B, double 0x4051DE4554A1C496, double 0x4052A753FA8203FF, double 0x40537062B953605F, double 0x405439718E2E2D44, double 0x40550280769A1716, double 0x4055CB8F7079BC64, double 0x4056949E79FB1C2A, double 0x40575DAD918AB34B, double 0x405826BCB5C9B72A, double 0x4058EFCBE58547AB, double 0x4059B8DB1FB0196F, double 0x405A81EA635CE070, double 0x405B4AF9AFB95F95, double 0x405C1409040B3012, double 0x405CDD185FABFF50, double 0x405DA627C20716B8, double 0x405E6F372A9735F0, double 0x405F384698E4519F, double 0x406000AB06413286, double 0x40606532C287EAEA, double 0x4060C9BA8119DE07, double 0x40612E4241CED5B1, double 0x406192CA04821915, double 0x4061F751C912513D, double 0x40625BD98F60C8A7, double 0x4062C061575186C2, double 0x406324E920CAB8BC, double 0x40638970EBB4CD04]
@M_PI = global double 0.000000e+00
define void @gauss_first_guess(i64 %0, double* nocapture %1) {
%3 = icmp sgt i64 %0, 0
br i1 %3, label %4, label %58
4: ; preds = %2
%5 = and i64 %0, 1
%6 = icmp eq i64 %0, 1
br i1 %6, label %41, label %7
7: ; preds = %4
%8 = and i64 %0, -2
br label %9
9: ; preds = %35, %7
%10 = phi i64 [ 0, %7 ], [ %38, %35 ]
%11 = phi i64 [ 0, %7 ], [ %39, %35 ]
%12 = icmp ult i64 %10, 50
br i1 %12, label %13, label %16
13: ; preds = %9
%14 = getelementptr inbounds [50 x double], [50 x double]* @__const.gauss_first_guess.gvals, i64 0, i64 %10
%15 = load double, double* %14
br label %22
16: ; preds = %9
%17 = add nsw i64 %10, -1
%18 = getelementptr inbounds double, double* %1, i64 %17
%19 = load double, double* %18
%20 = load double, double* @M_PI
%21 = fadd double %19, %20
br label %22
22: ; preds = %13, %16
%23 = phi double [ %15, %13 ], [ %21, %16 ]
%24 = getelementptr inbounds double, double* %1, i64 %10
store double %23, double* %24
%25 = or i64 %10, 1
%26 = icmp ult i64 %10, 49
br i1 %26, label %32, label %27
27: ; preds = %22
%28 = getelementptr inbounds double, double* %1, i64 %10
%29 = load double, double* %28
%30 = load double, double* @M_PI
%31 = fadd double %29, %30
br label %35
32: ; preds = %22
%33 = getelementptr inbounds [50 x double], [50 x double]* @__const.gauss_first_guess.gvals, i64 0, i64 %25
%34 = load double, double* %33
br label %35
35: ; preds = %32, %27
%36 = phi double [ %34, %32 ], [ %31, %27 ]
%37 = getelementptr inbounds double, double* %1, i64 %25
store double %36, double* %37
%38 = add nuw nsw i64 %10, 2
%39 = add i64 %11, 2
%40 = icmp eq i64 %39, %8
br i1 %40, label %41, label %9
41: ; preds = %35, %4
%42 = phi i64 [ 0, %4 ], [ %38, %35 ]
%43 = icmp eq i64 %5, 0
br i1 %43, label %58, label %44
44: ; preds = %41
%45 = icmp ult i64 %42, 50
br i1 %45, label %52, label %46
46: ; preds = %44
%47 = add nsw i64 %42, -1
%48 = getelementptr inbounds double, double* %1, i64 %47
%49 = load double, double* %48
%50 = load double, double* @M_PI
%51 = fadd double %49, %50
br label %55
52: ; preds = %44
%53 = getelementptr inbounds [50 x double], [50 x double]* @__const.gauss_first_guess.gvals, i64 0, i64 %42
%54 = load double, double* %53
br label %55
55: ; preds = %52, %46
%56 = phi double [ %54, %52 ], [ %51, %46 ]
%57 = getelementptr inbounds double, double* %1, i64 %42
store double %56, double* %57
br label %58
58: ; preds = %55, %41, %2
ret void
}