int multipoleSetup(unsigned int ANALYSIS, double *axis, unsigned int *nShape,
                   unsigned int *nOrder, double *R) {
  (*nOrder) = 1;
  (*nShape) = 0;
  (*R) = axis[0];
  switch (ANALYSIS) {
  case 5:
    (*nOrder) = 1;
    break;
  case 6:
    (*nOrder) = 2;
    break;
  case 7:
    (*nOrder) = 3;
    break;
  case 8:
    (*nOrder) = 4;
    break;
  case 9:
    (*nOrder) = 5;
    break;
  case 10:
    (*nOrder) = 1;
    (*nShape) = 1;
    break;
  case 11:
    (*nOrder) = 1;
    (*nShape) = 1;
    break;
  }
  return 0;
}


x86 assembly (clang, -O0):
<multipoleSetup>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x20(%rbp),%rax
movl   $0x1,(%rax)
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x4(%rbp),%eax
add    $0xfffffffb,%eax
mov    %eax,%ecx
mov    %rcx,-0x30(%rbp)
sub    $0x6,%eax
ja     11dc <multipoleSetup+0xdc>
mov    -0x30(%rbp),%rax
lea    0xea5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x20(%rbp),%rax
movl   $0x1,(%rax)
jmp    11dc <multipoleSetup+0xdc>
mov    -0x20(%rbp),%rax
movl   $0x2,(%rax)
jmp    11dc <multipoleSetup+0xdc>
mov    -0x20(%rbp),%rax
movl   $0x3,(%rax)
jmp    11dc <multipoleSetup+0xdc>
mov    -0x20(%rbp),%rax
movl   $0x4,(%rax)
jmp    11dc <multipoleSetup+0xdc>
mov    -0x20(%rbp),%rax
movl   $0x5,(%rax)
jmp    11dc <multipoleSetup+0xdc>
mov    -0x20(%rbp),%rax
movl   $0x1,(%rax)
mov    -0x18(%rbp),%rax
movl   $0x1,(%rax)
jmp    11dc <multipoleSetup+0xdc>
mov    -0x20(%rbp),%rax
movl   $0x1,(%rax)
mov    -0x18(%rbp),%rax
movl   $0x1,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<multipoleSetup>:
movl   $0x1,(%rcx)
movl   $0x0,(%rdx)
movsd  (%rsi),%xmm0
movsd  %xmm0,(%r8)
add    $0xfffffffb,%edi
cmp    $0x6,%edi
ja     1139 <multipoleSetup+0x39>
lea    0xedc(%rip),%rax
movslq (%rax,%rdi,4),%rsi
add    %rax,%rsi
jmp    *%rsi
movl   $0x1,(%rcx)
movl   $0x1,(%rdx)
xor    %eax,%eax
ret
movl   $0x1,(%rcx)
xor    %eax,%eax
ret
movl   $0x2,(%rcx)
xor    %eax,%eax
ret
movl   $0x3,(%rcx)
xor    %eax,%eax
ret
movl   $0x4,(%rcx)
xor    %eax,%eax
ret
movl   $0x5,(%rcx)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @multipoleSetup(i32 %0, double* %1, i32* %2, i32* %3, double* %4) {
%6 = alloca i32
%7 = alloca double*
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca double*
store i32 %0, i32* %6
store double* %1, double** %7
store i32* %2, i32** %8
store i32* %3, i32** %9
store double* %4, double** %10
%11 = load i32*, i32** %9
store i32 1, i32* %11
%12 = load i32*, i32** %8
store i32 0, i32* %12
%13 = load double*, double** %7
%14 = getelementptr inbounds double, double* %13, i64 0
%15 = load double, double* %14
%16 = load double*, double** %10
store double %15, double* %16
%17 = load i32, i32* %6
switch i32 %17, label %34 [
i32 5, label %18
i32 6, label %20
i32 7, label %22
i32 8, label %24
i32 9, label %26
i32 10, label %28
i32 11, label %31
]
18: ; preds = %5
%19 = load i32*, i32** %9
store i32 1, i32* %19
br label %34
20: ; preds = %5
%21 = load i32*, i32** %9
store i32 2, i32* %21
br label %34
22: ; preds = %5
%23 = load i32*, i32** %9
store i32 3, i32* %23
br label %34
24: ; preds = %5
%25 = load i32*, i32** %9
store i32 4, i32* %25
br label %34
26: ; preds = %5
%27 = load i32*, i32** %9
store i32 5, i32* %27
br label %34
28: ; preds = %5
%29 = load i32*, i32** %9
store i32 1, i32* %29
%30 = load i32*, i32** %8
store i32 1, i32* %30
br label %34
31: ; preds = %5
%32 = load i32*, i32** %9
store i32 1, i32* %32
%33 = load i32*, i32** %8
store i32 1, i32* %33
br label %34
34: ; preds = %5, %31, %28, %26, %24, %22, %20, %18
ret i32 0
}

LLVM IR (-O2):
define i32 @multipoleSetup(i32 %0, double* nocapture %1, i32* nocapture writeonly %2, i32* nocapture writeonly %3, double* nocapture writeonly %4) {
store i32 1, i32* %3
store i32 0, i32* %2
%6 = load double, double* %1
store double %6, double* %4
switch i32 %0, label %14 [
i32 5, label %7
i32 6, label %8
i32 7, label %9
i32 8, label %10
i32 9, label %11
i32 10, label %12
i32 11, label %13
]
7: ; preds = %5
store i32 1, i32* %3
br label %14
8: ; preds = %5
store i32 2, i32* %3
br label %14
9: ; preds = %5
store i32 3, i32* %3
br label %14
10: ; preds = %5
store i32 4, i32* %3
br label %14
11: ; preds = %5
store i32 5, i32* %3
br label %14
12: ; preds = %5
store i32 1, i32* %3
store i32 1, i32* %2
br label %14
13: ; preds = %5
store i32 1, i32* %3
store i32 1, i32* %2
br label %14
14: ; preds = %5, %13, %12, %11, %10, %9, %8, %7
ret i32 0
}