#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*/ sqrt(int);
bool fill_poles(double *z, int order) {
  switch (order) {
  case 1:
    break;
  case 3:
    z[0] = sqrt(3) - 2;
    break;
  case 5:
    z[0] = -4.305753470999738e-1;
    z[1] = -4.309628820326465e-2;
    break;
  case 7:
    z[0] = -5.352804307964382e-1;
    z[1] = -1.225546151923267e-1;
    z[2] = -9.148694809608277e-3;
    break;
  case 9:
    z[0] = -6.079973891686259e-1;
    z[1] = -2.017505201931532e-1;
    z[2] = -4.322260854048175e-2;
    z[3] = -2.121306903180818e-3;
    break;
  case 11:
    z[0] = -6.612660689007345e-1;
    z[1] = -2.721803492947859e-1;
    z[2] = -8.975959979371331e-2;
    z[3] = -1.666962736623466e-2;
    z[4] = -5.105575344465021e-4;
    break;
  default:
    return false;
  }
  return true;
}


x86 assembly (clang, -O0):
<fill_poles>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x20(%rbp)
sub    $0xa,%eax
ja     1269 <fill_poles+0x159>
mov    -0x20(%rbp),%rax
lea    0xf31(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
jmp    1275 <fill_poles+0x165>
mov    $0x3,%edi
call   1030 <sqrt@plt>
sub    $0x2,%eax
cvtsi2sd %eax,%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    1275 <fill_poles+0x165>
mov    -0x10(%rbp),%rax
movsd  0xef1(%rip),%xmm0
movsd  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movsd  0xed9(%rip),%xmm0
movsd  %xmm0,0x8(%rax)
jmp    1275 <fill_poles+0x165>
mov    -0x10(%rbp),%rax
movsd  0xebb(%rip),%xmm0
movsd  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movsd  0xea3(%rip),%xmm0
movsd  %xmm0,0x8(%rax)
mov    -0x10(%rbp),%rax
movsd  0xe8a(%rip),%xmm0
movsd  %xmm0,0x10(%rax)
jmp    1275 <fill_poles+0x165>
mov    -0x10(%rbp),%rax
movsd  0xe6c(%rip),%xmm0
movsd  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movsd  0xe54(%rip),%xmm0
movsd  %xmm0,0x8(%rax)
mov    -0x10(%rbp),%rax
movsd  0xe3b(%rip),%xmm0
movsd  %xmm0,0x10(%rax)
mov    -0x10(%rbp),%rax
movsd  0xe22(%rip),%xmm0
movsd  %xmm0,0x18(%rax)
jmp    1275 <fill_poles+0x165>
mov    -0x10(%rbp),%rax
movsd  0xe04(%rip),%xmm0
movsd  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movsd  0xdec(%rip),%xmm0
movsd  %xmm0,0x8(%rax)
mov    -0x10(%rbp),%rax
movsd  0xdd3(%rip),%xmm0
movsd  %xmm0,0x10(%rax)
mov    -0x10(%rbp),%rax
movsd  0xdba(%rip),%xmm0
movsd  %xmm0,0x18(%rax)
mov    -0x10(%rbp),%rax
movsd  0xda1(%rip),%xmm0
movsd  %xmm0,0x20(%rax)
jmp    1275 <fill_poles+0x165>
movl   $0x0,-0x4(%rbp)
jmp    127c <fill_poles+0x16c>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fill_poles>:
push   %rbx
xor    %eax,%eax
add    $0xffffffff,%esi
cmp    $0xa,%esi
ja     11b6 <fill_poles+0xa6>
mov    %rdi,%rbx
lea    0xf37(%rip),%rcx
movslq (%rcx,%rsi,4),%rdx
add    %rcx,%rdx
jmp    *%rdx
mov    $0x3,%edi
call   1030 <sqrt@plt>
add    $0xfffffffe,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,(%rbx)
jmp    11b1 <fill_poles+0xa1>
movapd 0xeff(%rip),%xmm0
movupd %xmm0,(%rbx)
jmp    11b1 <fill_poles+0xa1>
movapd 0xee1(%rip),%xmm0
movupd %xmm0,(%rbx)
movabs $0xbf82bc8d08111b1d,%rax
bc 82 bf
mov    %rax,0x10(%rbx)
jmp    11b1 <fill_poles+0xa1>
movaps 0xea6(%rip),%xmm0
movups %xmm0,(%rbx)
movapd 0xeab(%rip),%xmm0
movupd %xmm0,0x10(%rbx)
jmp    11b1 <fill_poles+0xa1>
movaps 0xe6d(%rip),%xmm0
movups %xmm0,(%rbx)
movapd 0xe72(%rip),%xmm0
movupd %xmm0,0x10(%rbx)
movabs $0xbf40baddf4e2e3ba,%rax
ba 40 bf
mov    %rax,0x20(%rbx)
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @fill_poles(double* %0, i32 %1) {
%3 = alloca i32
%4 = alloca double*
%5 = alloca i32
store double* %0, double** %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
switch i32 %6, label %46 [
i32 1, label %7
i32 3, label %8
i32 5, label %14
i32 7, label %19
i32 9, label %26
i32 11, label %35
]
7: ; preds = %2
br label %47
8: ; preds = %2
%9 = call i32 @sqrt(i32 3)
%10 = sub nsw i32 %9, 2
%11 = sitofp i32 %10 to double
%12 = load double*, double** %4
%13 = getelementptr inbounds double, double* %12, i64 0
store double %11, double* %13
br label %47
14: ; preds = %2
%15 = load double*, double** %4
%16 = getelementptr inbounds double, double* %15, i64 0
store double 0xBFDB8E8BE69086F0, double* %16
%17 = load double*, double** %4
%18 = getelementptr inbounds double, double* %17, i64 1
store double 0xBFA610B778D2F346, double* %18
br label %47
19: ; preds = %2
%20 = load double*, double** %4
%21 = getelementptr inbounds double, double* %20, i64 0
store double 0xBFE121046D0EB42B, double* %21
%22 = load double*, double** %4
%23 = getelementptr inbounds double, double* %22, i64 1
store double 0xBFBF5FBD40399391, double* %23
%24 = load double*, double** %4
%25 = getelementptr inbounds double, double* %24, i64 2
store double 0xBF82BC8D08111B1D, double* %25
br label %47
26: ; preds = %2
%27 = load double*, double** %4
%28 = getelementptr inbounds double, double* %27, i64 0
store double 0xBFE374B6F0D10B54, double* %28
%29 = load double*, double** %4
%30 = getelementptr inbounds double, double* %29, i64 1
store double 0xBFC9D2F607171D44, double* %30
%31 = load double*, double** %4
%32 = getelementptr inbounds double, double* %31, i64 2
store double 0xBFA62146144223CE, double* %32
%33 = load double*, double** %4
%34 = getelementptr inbounds double, double* %33, i64 3
store double 0xBF6160B3F8C41F30, double* %34
br label %47
35: ; preds = %2
%36 = load double*, double** %4
%37 = getelementptr inbounds double, double* %36, i64 0
store double 0xBFE52917757C42A9, double* %37
%38 = load double*, double** %4
%39 = getelementptr inbounds double, double* %38, i64 1
store double 0xBFD16B6720B57005, double* %39
%40 = load double*, double** %4
%41 = getelementptr inbounds double, double* %40, i64 2
store double 0xBFB6FA7C319DB542, double* %41
%42 = load double*, double** %4
%43 = getelementptr inbounds double, double* %42, i64 3
store double 0xBF9111D7C17F78DC, double* %43
%44 = load double*, double** %4
%45 = getelementptr inbounds double, double* %44, i64 4
store double 0xBF40BADDF4E2E3BA, double* %45
br label %47
46: ; preds = %2
store i32 0, i32* %3
br label %48
47: ; preds = %35, %26, %19, %14, %8, %7
store i32 1, i32* %3
br label %48
48: ; preds = %47, %46
%49 = load i32, i32* %3
ret i32 %49
}

LLVM IR (-O2):
define i32 @fill_poles(double* nocapture writeonly %0, i32 %1) {
switch i32 %1, label %22 [
i32 1, label %21
i32 3, label %3
i32 5, label %7
i32 7, label %9
i32 9, label %12
i32 11, label %16
]
3: ; preds = %2
%4 = tail call i32 @sqrt(i32 3)
%5 = add nsw i32 %4, -2
%6 = sitofp i32 %5 to double
store double %6, double* %0
br label %21
7: ; preds = %2
%8 = bitcast double* %0 to <2 x double>*
store <2 x double> <double 0xBFDB8E8BE69086F0, double 0xBFA610B778D2F346>, <2 x double>* %8
br label %21
9: ; preds = %2
%10 = bitcast double* %0 to <2 x double>*
store <2 x double> <double 0xBFE121046D0EB42B, double 0xBFBF5FBD40399391>, <2 x double>* %10
%11 = getelementptr inbounds double, double* %0, i64 2
store double 0xBF82BC8D08111B1D, double* %11
br label %21
12: ; preds = %2
%13 = bitcast double* %0 to <2 x double>*
store <2 x double> <double 0xBFE374B6F0D10B54, double 0xBFC9D2F607171D44>, <2 x double>* %13
%14 = getelementptr inbounds double, double* %0, i64 2
%15 = bitcast double* %14 to <2 x double>*
store <2 x double> <double 0xBFA62146144223CE, double 0xBF6160B3F8C41F30>, <2 x double>* %15
br label %21
16: ; preds = %2
%17 = bitcast double* %0 to <2 x double>*
store <2 x double> <double 0xBFE52917757C42A9, double 0xBFD16B6720B57005>, <2 x double>* %17
%18 = getelementptr inbounds double, double* %0, i64 2
%19 = bitcast double* %18 to <2 x double>*
store <2 x double> <double 0xBFB6FA7C319DB542, double 0xBF9111D7C17F78DC>, <2 x double>* %19
%20 = getelementptr inbounds double, double* %0, i64 4
store double 0xBF40BADDF4E2E3BA, double* %20
br label %21
21: ; preds = %16, %12, %9, %7, %3, %2
br label %22
22: ; preds = %2, %21
%23 = phi i32 [ 1, %21 ], [ 0, %2 ]
ret i32 %23
}