#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 acos(double);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
scalar_t__ fmod(int, int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, int, long);
int /*<<< orphan*/ mk_pix2xy(int *, int *);
int /*<<< orphan*/ stderr;
void pix2ang_nest(long nside, long ipix, double *theta, double *phi) {
  int npix, npface, face_num;
  int ipf, ip_low, ip_trunc, ip_med, ip_hi;
  int ix, iy, jrt, jr, nr, jpt, jp, kshift, nl4;
  double z, fn, fact1, fact2;
  double piover2 = 0.5 * 3.14159265358979323846;
  int ns_max = 8192;
  static int pix2x[1024], pix2y[1024];
  int jrll[12], jpll[12];
  jrll[0] = 2;
  jrll[1] = 2;
  jrll[2] = 2;
  jrll[3] = 2;
  jrll[4] = 3;
  jrll[5] = 3;
  jrll[6] = 3;
  jrll[7] = 3;
  jrll[8] = 4;
  jrll[9] = 4;
  jrll[10] = 4;
  jrll[11] = 4;
  jpll[0] = 1;
  jpll[1] = 3;
  jpll[2] = 5;
  jpll[3] = 7;
  jpll[4] = 0;
  jpll[5] = 2;
  jpll[6] = 4;
  jpll[7] = 6;
  jpll[8] = 1;
  jpll[9] = 3;
  jpll[10] = 5;
  jpll[11] = 7;
  if (nside < 1 || nside > ns_max) {
    fprintf(stderr, "%s (%d): nside out of range: %ld\n",
            "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
            "2022-01-22/02-19-57/repos/ezralanglois/arachnid/refs/heads/master/"
            "arachnid/core/orient/core/healpix/pix2ang_nest.c",
            91, nside);
    exit(0);
  }
  npix = 12 * nside * nside;
  if (ipix < 0 || ipix > npix - 1) {
    fprintf(stderr, "%s (%d): ipix out of range: %ld\n",
            "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
            "2022-01-22/02-19-57/repos/ezralanglois/arachnid/refs/heads/master/"
            "arachnid/core/orient/core/healpix/pix2ang_nest.c",
            96, ipix);
    exit(0);
  }
  if (pix2x[1023] <= 0)
    mk_pix2xy(pix2x, pix2y);
  fn = 1. * nside;
  fact1 = 1. / (3. * fn * fn);
  fact2 = 2. / (3. * fn);
  nl4 = 4 * nside;
  npface = nside * nside;
  face_num = ipix / npface;
  ipf = (int)fmod(ipix, npface);
  ip_low = (int)fmod(ipf, 1024);
  ip_trunc = ipf / 1024;
  ip_med = (int)fmod(ip_trunc, 1024);
  ip_hi = ip_trunc / 1024;
  ix = 1024 * pix2x[ip_hi] + 32 * pix2x[ip_med] + pix2x[ip_low];
  iy = 1024 * pix2y[ip_hi] + 32 * pix2y[ip_med] + pix2y[ip_low];
  jrt = ix + iy;
  jpt = ix - iy;
  jr = jrll[face_num] * nside - jrt - 1;
  nr = nside;
  z = (2 * nside - jr) * fact2;
  kshift = (int)fmod(jr - nside, 2);
  if (jr < nside) {
    nr = jr;
    z = 1. - nr * nr * fact1;
    kshift = 0;
  } else {
    if (jr > 3 * nside) {
      nr = nl4 - jr;
      z = -1. + nr * nr * fact1;
      kshift = 0;
    }
  }
  *theta = acos(z);
  jp = (jpll[face_num] * nr + jpt + 1 + kshift) / 2;
  if (jp > nl4)
    jp = jp - nl4;
  if (jp < 1)
    jp = jp + nl4;
  *phi = (jp - (kshift + 1) * 0.5) * (piover2 / nr);
}


x86 assembly (clang, -O0):
<pix2ang_nest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
movsd  0xe8d(%rip),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movl   $0x2000,-0x94(%rbp)
movl   $0x2,-0xd0(%rbp)
movl   $0x2,-0xcc(%rbp)
movl   $0x2,-0xc8(%rbp)
movl   $0x2,-0xc4(%rbp)
movl   $0x3,-0xc0(%rbp)
movl   $0x3,-0xbc(%rbp)
movl   $0x3,-0xb8(%rbp)
movl   $0x3,-0xb4(%rbp)
movl   $0x4,-0xb0(%rbp)
movl   $0x4,-0xac(%rbp)
movl   $0x4,-0xa8(%rbp)
movl   $0x4,-0xa4(%rbp)
movl   $0x1,-0x100(%rbp)
movl   $0x3,-0xfc(%rbp)
movl   $0x5,-0xf8(%rbp)
movl   $0x7,-0xf4(%rbp)
movl   $0x0,-0xf0(%rbp)
movl   $0x2,-0xec(%rbp)
movl   $0x4,-0xe8(%rbp)
movl   $0x6,-0xe4(%rbp)
movl   $0x1,-0xe0(%rbp)
movl   $0x3,-0xdc(%rbp)
movl   $0x5,-0xd8(%rbp)
movl   $0x7,-0xd4(%rbp)
cmpq   $0x1,-0x8(%rbp)
jl     1294 <pix2ang_nest+0x144>
mov    -0x8(%rbp),%rax
movslq -0x94(%rbp),%rcx
cmp    %rcx,%rax
jle    12c0 <pix2ang_nest+0x170>
mov    0x2d45(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%r8
lea    0xd88(%rip),%rsi
lea    0xda3(%rip),%rdx
mov    $0x5b,%ecx
call   1060 <fprintf@plt>
xor    %edi,%edi
call   1070 <exit@plt>
imul   $0xc,-0x8(%rbp),%rax
imul   -0x8(%rbp),%rax
mov    %eax,-0x24(%rbp)
cmpq   $0x0,-0x10(%rbp)
jl     12ee <pix2ang_nest+0x19e>
mov    -0x10(%rbp),%rax
mov    -0x24(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
cmp    %rcx,%rax
jle    131a <pix2ang_nest+0x1ca>
mov    0x2ceb(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%r8
lea    0xe03(%rip),%rsi
lea    0xd49(%rip),%rdx
mov    $0x60,%ecx
call   1060 <fprintf@plt>
xor    %edi,%edi
call   1070 <exit@plt>
cmpl   $0x0,0x3d3b(%rip)
jg     133a <pix2ang_nest+0x1ea>
lea    0x2d32(%rip),%rdi
lea    0x3d2b(%rip),%rsi
call   1050 <mk_pix2xy@plt>
cvtsi2sdq -0x8(%rbp),%xmm1
movsd  0xcd0(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  0xcb7(%rip),%xmm1
mulsd  -0x78(%rbp),%xmm1
mulsd  -0x78(%rbp),%xmm1
movsd  0xcad(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  0xc94(%rip),%xmm1
mulsd  -0x78(%rbp),%xmm1
movsd  0xc7f(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
mov    -0x8(%rbp),%rax
shl    $0x2,%rax
mov    %eax,-0x64(%rbp)
mov    -0x8(%rbp),%rax
imul   -0x8(%rbp),%rax
mov    %eax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x28(%rbp),%rcx
cqto
idiv   %rcx
mov    %eax,-0x2c(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,%edi
mov    -0x28(%rbp),%esi
call   1030 <fmod@plt>
mov    %eax,-0x30(%rbp)
mov    -0x30(%rbp),%edi
mov    $0x400,%esi
call   1030 <fmod@plt>
mov    %eax,-0x34(%rbp)
mov    -0x30(%rbp),%eax
mov    $0x400,%ecx
cltd
idiv   %ecx
mov    %eax,-0x38(%rbp)
mov    -0x38(%rbp),%edi
mov    $0x400,%esi
call   1030 <fmod@plt>
mov    %eax,-0x3c(%rbp)
mov    -0x38(%rbp),%eax
mov    $0x400,%ecx
cltd
idiv   %ecx
mov    %eax,-0x40(%rbp)
movslq -0x40(%rbp),%rcx
lea    0x2c4c(%rip),%rax
mov    (%rax,%rcx,4),%eax
shl    $0xa,%eax
movslq -0x3c(%rbp),%rdx
lea    0x2c3b(%rip),%rcx
mov    (%rcx,%rdx,4),%ecx
shl    $0x5,%ecx
add    %ecx,%eax
movslq -0x34(%rbp),%rdx
lea    0x2c28(%rip),%rcx
add    (%rcx,%rdx,4),%eax
mov    %eax,-0x44(%rbp)
movslq -0x40(%rbp),%rcx
lea    0x3c17(%rip),%rax
mov    (%rax,%rcx,4),%eax
shl    $0xa,%eax
movslq -0x3c(%rbp),%rdx
lea    0x3c06(%rip),%rcx
mov    (%rcx,%rdx,4),%ecx
shl    $0x5,%ecx
add    %ecx,%eax
movslq -0x34(%rbp),%rdx
lea    0x3bf3(%rip),%rcx
add    (%rcx,%rdx,4),%eax
mov    %eax,-0x48(%rbp)
mov    -0x44(%rbp),%eax
add    -0x48(%rbp),%eax
mov    %eax,-0x4c(%rbp)
mov    -0x44(%rbp),%eax
sub    -0x48(%rbp),%eax
mov    %eax,-0x58(%rbp)
movslq -0x2c(%rbp),%rax
movslq -0xd0(%rbp,%rax,4),%rax
ff
imul   -0x8(%rbp),%rax
movslq -0x4c(%rbp),%rcx
sub    %rcx,%rax
sub    $0x1,%rax
mov    %eax,-0x50(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,-0x54(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x1,%rax
movslq -0x50(%rbp),%rcx
sub    %rcx,%rax
cvtsi2sd %rax,%xmm0
mulsd  -0x88(%rbp),%xmm0
ff
movsd  %xmm0,-0x70(%rbp)
movslq -0x50(%rbp),%rax
sub    -0x8(%rbp),%rax
mov    %eax,%edi
mov    $0x2,%esi
call   1030 <fmod@plt>
mov    %eax,-0x60(%rbp)
movslq -0x50(%rbp),%rax
cmp    -0x8(%rbp),%rax
jge    153f <pix2ang_nest+0x3ef>
mov    -0x50(%rbp),%eax
mov    %eax,-0x54(%rbp)
mov    -0x54(%rbp),%eax
imul   -0x54(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  -0x80(%rbp),%xmm1
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm1,%xmm0
movsd  0xaee(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
movl   $0x0,-0x60(%rbp)
jmp    158b <pix2ang_nest+0x43b>
movslq -0x50(%rbp),%rax
imul   $0x3,-0x8(%rbp),%rcx
cmp    %rcx,%rax
jle    1586 <pix2ang_nest+0x436>
mov    -0x64(%rbp),%eax
sub    -0x50(%rbp),%eax
mov    %eax,-0x54(%rbp)
mov    -0x54(%rbp),%eax
imul   -0x54(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  -0x80(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xaaa(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
movl   $0x0,-0x60(%rbp)
jmp    158b <pix2ang_nest+0x43b>
movsd  -0x70(%rbp),%xmm0
call   1040 <acos@plt>
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
movslq -0x2c(%rbp),%rax
mov    -0x100(%rbp,%rax,4),%eax
imul   -0x54(%rbp),%eax
add    -0x58(%rbp),%eax
add    $0x1,%eax
add    -0x60(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x5c(%rbp)
mov    -0x5c(%rbp),%eax
cmp    -0x64(%rbp),%eax
jle    15d5 <pix2ang_nest+0x485>
mov    -0x5c(%rbp),%eax
sub    -0x64(%rbp),%eax
mov    %eax,-0x5c(%rbp)
cmpl   $0x1,-0x5c(%rbp)
jge    15e8 <pix2ang_nest+0x498>
mov    -0x5c(%rbp),%eax
add    -0x64(%rbp),%eax
mov    %eax,-0x5c(%rbp)
cvtsi2sdl -0x5c(%rbp),%xmm1
mov    -0x60(%rbp),%eax
add    $0x1,%eax
cvtsi2sd %eax,%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  0xa12(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x90(%rbp),%xmm1
ff
cvtsi2sdl -0x54(%rbp),%xmm2
divsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pix2ang_nest>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x98,%rsp
mov    %rdi,%r13
movaps 0xe95(%rip),%xmm0
movaps %xmm0,0x60(%rsp)
movaps 0xe99(%rip),%xmm0
movaps %xmm0,0x70(%rsp)
movaps 0xe9d(%rip),%xmm0
movaps %xmm0,0x80(%rsp)
movaps 0xe9e(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xea2(%rip),%xmm1
movaps %xmm1,0x40(%rsp)
movaps %xmm0,0x50(%rsp)
lea    -0x2001(%rdi),%rax
cmp    $0xffffffffffffdfff,%rax
jbe    144e <pix2ang_nest+0x2fe>
mov    %rsi,%rbx
test   %rsi,%rsi
js     142d <pix2ang_nest+0x2dd>
mov    %r13,%rbp
imul   %r13,%rbp
lea    0x0(%rbp,%rbp,2),%eax
lea    -0x1(,%rax,4),%eax
cmp    %rbx,%rax
jb     142d <pix2ang_nest+0x2dd>
mov    %rcx,%r14
mov    %rdx,%r15
cmpl   $0x0,0x3e6d(%rip)
jg     1204 <pix2ang_nest+0xb4>
lea    0x2e68(%rip),%rdi
lea    0x3e61(%rip),%rsi
call   1050 <mk_pix2xy@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %r13,%xmm0
movsd  0xe3c(%rip),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,0x10(%rsp)
mulsd  %xmm1,%xmm0
movsd  0xe2e(%rip),%xmm1
mov    %rbx,%rax
or     %rbp,%rax
shr    $0x20,%rax
mov    %r14,0x28(%rsp)
mov    %r15,0x20(%rsp)
je     124d <pix2ang_nest+0xfd>
mov    %rbx,%rax
xor    %edx,%edx
div    %rbp
mov    %rax,%r12
jmp    1256 <pix2ang_nest+0x106>
mov    %ebx,%eax
xor    %edx,%edx
div    %ebp
mov    %eax,%r12d
movapd %xmm1,%xmm2
divsd  %xmm0,%xmm2
movsd  %xmm2,0x8(%rsp)
lea    0x0(,%r13,4),%r14d
mov    %ebx,%edi
mov    %ebp,%esi
call   1030 <fmod@plt>
mov    %rax,%rbp
mov    %ebp,%edi
mov    $0x400,%esi
call   1030 <fmod@plt>
mov    %rax,%r15
lea    0x3ff(%rbp),%edi
test   %ebp,%ebp
cmovns %ebp,%edi
lea    0xfffff(%rbp),%ebx
cmovns %ebp,%ebx
sar    $0xa,%edi
mov    $0x400,%esi
call   1030 <fmod@plt>
sar    $0x14,%ebx
movslq %ebx,%rcx
lea    0x2dab(%rip),%rdx
mov    (%rdx,%rcx,4),%esi
shl    $0xa,%esi
cltq
mov    (%rdx,%rax,4),%ebp
shl    $0x5,%ebp
add    %esi,%ebp
movslq %r15d,%rsi
add    (%rdx,%rsi,4),%ebp
lea    0x3d8e(%rip),%rdx
mov    (%rdx,%rcx,4),%ecx
shl    $0xa,%ecx
mov    (%rdx,%rax,4),%r15d
shl    $0x5,%r15d
add    %ecx,%r15d
add    (%rdx,%rsi,4),%r15d
lea    (%r15,%rbp,1),%eax
mov    %r12d,%ecx
not    %eax
mov    %rcx,0x18(%rsp)
mov    0x60(%rsp,%rcx,4),%ebx
imul   %r13d,%ebx
add    %eax,%ebx
movslq %ebx,%r12
mov    %r12d,%edi
sub    %r13d,%edi
mov    $0x2,%esi
call   1030 <fmod@plt>
mov    %r13,%rcx
cmp    %r13,%r12
jge    133e <pix2ang_nest+0x1ee>
mov    %ebx,%eax
imul   %ebx,%eax
cvtsi2sd %eax,%xmm0
mulsd  0x8(%rsp),%xmm0
movsd  0xd27(%rip),%xmm1
subsd  %xmm0,%xmm1
xor    %r13d,%r13d
movapd %xmm1,%xmm0
jmp    1394 <pix2ang_nest+0x244>
mov    %rax,%r13
movsd  0x8(%rsp),%xmm1
lea    (%rcx,%rcx,2),%rax
cmp    %r12,%rax
jge    136f <pix2ang_nest+0x21f>
mov    %r14d,%eax
sub    %ebx,%eax
mov    %eax,%ebx
imul   %eax,%eax
cvtsi2sd %eax,%xmm0
mulsd  %xmm1,%xmm0
addsd  0xcfe(%rip),%xmm0
xor    %r13d,%r13d
jmp    1394 <pix2ang_nest+0x244>
mov    %rcx,%rax
add    %rcx,%rax
sub    %r12,%rax
xorps  %xmm1,%xmm1
cvtsi2sd %rax,%xmm1
movsd  0xcd8(%rip),%xmm0
divsd  0x10(%rsp),%xmm0
mulsd  %xmm1,%xmm0
mov    %ecx,%ebx
call   1040 <acos@plt>
mov    0x20(%rsp),%rax
movsd  %xmm0,(%rax)
mov    0x18(%rsp),%rax
mov    0x30(%rsp,%rax,4),%eax
imul   %ebx,%eax
mov    %r13d,%ecx
add    $0x1,%ecx
lea    0x1(%r13,%rbp,1),%edx
sub    %r15d,%edx
add    %eax,%edx
mov    %edx,%eax
shr    $0x1f,%eax
add    %edx,%eax
sar    %eax
xor    %edx,%edx
cmp    %r14d,%eax
mov    $0x0,%esi
cmovg  %r14d,%esi
sub    %esi,%eax
test   %eax,%eax
cmovg  %edx,%r14d
add    %eax,%r14d
xorps  %xmm0,%xmm0
cvtsi2sd %r14d,%xmm0
xorps  %xmm1,%xmm1
cvtsi2sd %ecx,%xmm1
mulsd  0xc79(%rip),%xmm1
addsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsi2sd %ebx,%xmm0
movsd  0xc6e(%rip),%xmm2
divsd  %xmm0,%xmm2
mulsd  %xmm1,%xmm2
mov    0x28(%rsp),%rax
movsd  %xmm2,(%rax)
add    $0x98,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2bac(%rip),%rax
mov    (%rax),%edi
lea    0xd18(%rip),%rsi
lea    0xc5e(%rip),%rdx
mov    $0x60,%ecx
mov    %rbx,%r8
jmp    146d <pix2ang_nest+0x31d>
mov    0x2b8b(%rip),%rax
mov    (%rax),%edi
lea    0xc22(%rip),%rsi
lea    0xc3d(%rip),%rdx
mov    $0x5b,%ecx
mov    %r13,%r8
call   1060 <fprintf@plt>
xor    %edi,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@pix2ang_nest.pix2x = internal global [1024 x i32] zeroinitializer
@pix2ang_nest.pix2y = internal global [1024 x i32] zeroinitializer
@stderr = global i32 0
@.str = [34 x i8] c"%s (%d): nside out of range: %ld\0A\00"
@.str.1 = [179 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/ezralanglois/arachnid/refs/heads/master/arachnid/core/orient/core/healpix/pix2ang_nest.c\00"
@.str.2 = [33 x i8] c"%s (%d): ipix out of range: %ld\0A\00"
define void @pix2ang_nest(i64 %0, i64 %1, double* %2, double* %3) {
%5 = alloca i64
%6 = alloca i64
%7 = alloca double*
%8 = alloca double*
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32
%22 = alloca i32
%23 = alloca i32
%24 = alloca i32
%25 = alloca i32
%26 = alloca double
%27 = alloca double
%28 = alloca double
%29 = alloca double
%30 = alloca double
%31 = alloca i32
%32 = alloca [12 x i32]
%33 = alloca [12 x i32]
store i64 %0, i64* %5
store i64 %1, i64* %6
store double* %2, double** %7
store double* %3, double** %8
store double 0x3FF921FB54442D18, double* %30
store i32 8192, i32* %31
%34 = getelementptr inbounds [12 x i32], [12 x i32]* %32, i64 0, i64 0
store i32 2, i32* %34
%35 = getelementptr inbounds [12 x i32], [12 x i32]* %32, i64 0, i64 1
store i32 2, i32* %35
%36 = getelementptr inbounds [12 x i32], [12 x i32]* %32, i64 0, i64 2
store i32 2, i32* %36
%37 = getelementptr inbounds [12 x i32], [12 x i32]* %32, i64 0, i64 3
store i32 2, i32* %37
%38 = getelementptr inbounds [12 x i32], [12 x i32]* %32, i64 0, i64 4
store i32 3, i32* %38
%39 = getelementptr inbounds [12 x i32], [12 x i32]* %32, i64 0, i64 5
store i32 3, i32* %39
%40 = getelementptr inbounds [12 x i32], [12 x i32]* %32, i64 0, i64 6
store i32 3, i32* %40
%41 = getelementptr inbounds [12 x i32], [12 x i32]* %32, i64 0, i64 7
store i32 3, i32* %41
%42 = getelementptr inbounds [12 x i32], [12 x i32]* %32, i64 0, i64 8
store i32 4, i32* %42
%43 = getelementptr inbounds [12 x i32], [12 x i32]* %32, i64 0, i64 9
store i32 4, i32* %43
%44 = getelementptr inbounds [12 x i32], [12 x i32]* %32, i64 0, i64 10
store i32 4, i32* %44
%45 = getelementptr inbounds [12 x i32], [12 x i32]* %32, i64 0, i64 11
store i32 4, i32* %45
%46 = getelementptr inbounds [12 x i32], [12 x i32]* %33, i64 0, i64 0
store i32 1, i32* %46
%47 = getelementptr inbounds [12 x i32], [12 x i32]* %33, i64 0, i64 1
store i32 3, i32* %47
%48 = getelementptr inbounds [12 x i32], [12 x i32]* %33, i64 0, i64 2
store i32 5, i32* %48
%49 = getelementptr inbounds [12 x i32], [12 x i32]* %33, i64 0, i64 3
store i32 7, i32* %49
%50 = getelementptr inbounds [12 x i32], [12 x i32]* %33, i64 0, i64 4
store i32 0, i32* %50
%51 = getelementptr inbounds [12 x i32], [12 x i32]* %33, i64 0, i64 5
store i32 2, i32* %51
%52 = getelementptr inbounds [12 x i32], [12 x i32]* %33, i64 0, i64 6
store i32 4, i32* %52
%53 = getelementptr inbounds [12 x i32], [12 x i32]* %33, i64 0, i64 7
store i32 6, i32* %53
%54 = getelementptr inbounds [12 x i32], [12 x i32]* %33, i64 0, i64 8
store i32 1, i32* %54
%55 = getelementptr inbounds [12 x i32], [12 x i32]* %33, i64 0, i64 9
store i32 3, i32* %55
%56 = getelementptr inbounds [12 x i32], [12 x i32]* %33, i64 0, i64 10
store i32 5, i32* %56
%57 = getelementptr inbounds [12 x i32], [12 x i32]* %33, i64 0, i64 11
store i32 7, i32* %57
%58 = load i64, i64* %5
%59 = icmp slt i64 %58, 1
br i1 %59, label %65, label %60
60: ; preds = %4
%61 = load i64, i64* %5
%62 = load i32, i32* %31
%63 = sext i32 %62 to i64
%64 = icmp sgt i64 %61, %63
br i1 %64, label %65, label %70
65: ; preds = %60, %4
%66 = load i32, i32* @stderr
%67 = load i64, i64* %5
%68 = call i32 @fprintf(i32 %66, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([179 x i8], [179 x i8]* @.str.1, i64 0, i64 0), i32 91, i64 %67)
%69 = call i32 @exit(i32 0)
unreachable
70: ; preds = %60
%71 = load i64, i64* %5
%72 = mul nsw i64 12, %71
%73 = load i64, i64* %5
%74 = mul nsw i64 %72, %73
%75 = trunc i64 %74 to i32
store i32 %75, i32* %9
%76 = load i64, i64* %6
%77 = icmp slt i64 %76, 0
br i1 %77, label %84, label %78
78: ; preds = %70
%79 = load i64, i64* %6
%80 = load i32, i32* %9
%81 = sub nsw i32 %80, 1
%82 = sext i32 %81 to i64
%83 = icmp sgt i64 %79, %82
br i1 %83, label %84, label %89
84: ; preds = %78, %70
%85 = load i32, i32* @stderr
%86 = load i64, i64* %6
%87 = call i32 @fprintf(i32 %85, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([179 x i8], [179 x i8]* @.str.1, i64 0, i64 0), i32 96, i64 %86)
%88 = call i32 @exit(i32 0)
unreachable
89: ; preds = %78
%90 = load i32, i32* getelementptr inbounds ([1024 x i32], [1024 x i32]* @pix2ang_nest.pix2x, i64 0, i64 1023)
%91 = icmp sle i32 %90, 0
br i1 %91, label %92, label %94
92: ; preds = %89
%93 = call i32 @mk_pix2xy(i32* getelementptr inbounds ([1024 x i32], [1024 x i32]* @pix2ang_nest.pix2x, i64 0, i64 0), i32* getelementptr inbounds ([1024 x i32], [1024 x i32]* @pix2ang_nest.pix2y, i64 0, i64 0))
br label %94
94: ; preds = %92, %89
%95 = load i64, i64* %5
%96 = sitofp i64 %95 to double
%97 = fmul double 1.000000e+00, %96
store double %97, double* %27
%98 = load double, double* %27
%99 = fmul double 3.000000e+00, %98
%100 = load double, double* %27
%101 = fmul double %99, %100
%102 = fdiv double 1.000000e+00, %101
store double %102, double* %28
%103 = load double, double* %27
%104 = fmul double 3.000000e+00, %103
%105 = fdiv double 2.000000e+00, %104
store double %105, double* %29
%106 = load i64, i64* %5
%107 = mul nsw i64 4, %106
%108 = trunc i64 %107 to i32
store i32 %108, i32* %25
%109 = load i64, i64* %5
%110 = load i64, i64* %5
%111 = mul nsw i64 %109, %110
%112 = trunc i64 %111 to i32
store i32 %112, i32* %10
%113 = load i64, i64* %6
%114 = load i32, i32* %10
%115 = sext i32 %114 to i64
%116 = sdiv i64 %113, %115
%117 = trunc i64 %116 to i32
store i32 %117, i32* %11
%118 = load i64, i64* %6
%119 = trunc i64 %118 to i32
%120 = load i32, i32* %10
%121 = call i64 @fmod(i32 %119, i32 %120)
%122 = trunc i64 %121 to i32
store i32 %122, i32* %12
%123 = load i32, i32* %12
%124 = call i64 @fmod(i32 %123, i32 1024)
%125 = trunc i64 %124 to i32
store i32 %125, i32* %13
%126 = load i32, i32* %12
%127 = sdiv i32 %126, 1024
store i32 %127, i32* %14
%128 = load i32, i32* %14
%129 = call i64 @fmod(i32 %128, i32 1024)
%130 = trunc i64 %129 to i32
store i32 %130, i32* %15
%131 = load i32, i32* %14
%132 = sdiv i32 %131, 1024
store i32 %132, i32* %16
%133 = load i32, i32* %16
%134 = sext i32 %133 to i64
%135 = getelementptr inbounds [1024 x i32], [1024 x i32]* @pix2ang_nest.pix2x, i64 0, i64 %134
%136 = load i32, i32* %135
%137 = mul nsw i32 1024, %136
%138 = load i32, i32* %15
%139 = sext i32 %138 to i64
%140 = getelementptr inbounds [1024 x i32], [1024 x i32]* @pix2ang_nest.pix2x, i64 0, i64 %139
%141 = load i32, i32* %140
%142 = mul nsw i32 32, %141
%143 = add nsw i32 %137, %142
%144 = load i32, i32* %13
%145 = sext i32 %144 to i64
%146 = getelementptr inbounds [1024 x i32], [1024 x i32]* @pix2ang_nest.pix2x, i64 0, i64 %145
%147 = load i32, i32* %146
%148 = add nsw i32 %143, %147
store i32 %148, i32* %17
%149 = load i32, i32* %16
%150 = sext i32 %149 to i64
%151 = getelementptr inbounds [1024 x i32], [1024 x i32]* @pix2ang_nest.pix2y, i64 0, i64 %150
%152 = load i32, i32* %151
%153 = mul nsw i32 1024, %152
%154 = load i32, i32* %15
%155 = sext i32 %154 to i64
%156 = getelementptr inbounds [1024 x i32], [1024 x i32]* @pix2ang_nest.pix2y, i64 0, i64 %155
%157 = load i32, i32* %156
%158 = mul nsw i32 32, %157
%159 = add nsw i32 %153, %158
%160 = load i32, i32* %13
%161 = sext i32 %160 to i64
%162 = getelementptr inbounds [1024 x i32], [1024 x i32]* @pix2ang_nest.pix2y, i64 0, i64 %161
%163 = load i32, i32* %162
%164 = add nsw i32 %159, %163
store i32 %164, i32* %18
%165 = load i32, i32* %17
%166 = load i32, i32* %18
%167 = add nsw i32 %165, %166
store i32 %167, i32* %19
%168 = load i32, i32* %17
%169 = load i32, i32* %18
%170 = sub nsw i32 %168, %169
store i32 %170, i32* %22
%171 = load i32, i32* %11
%172 = sext i32 %171 to i64
%173 = getelementptr inbounds [12 x i32], [12 x i32]* %32, i64 0, i64 %172
%174 = load i32, i32* %173
%175 = sext i32 %174 to i64
%176 = load i64, i64* %5
%177 = mul nsw i64 %175, %176
%178 = load i32, i32* %19
%179 = sext i32 %178 to i64
%180 = sub nsw i64 %177, %179
%181 = sub nsw i64 %180, 1
%182 = trunc i64 %181 to i32
store i32 %182, i32* %20
%183 = load i64, i64* %5
%184 = trunc i64 %183 to i32
store i32 %184, i32* %21
%185 = load i64, i64* %5
%186 = mul nsw i64 2, %185
%187 = load i32, i32* %20
%188 = sext i32 %187 to i64
%189 = sub nsw i64 %186, %188
%190 = sitofp i64 %189 to double
%191 = load double, double* %29
%192 = fmul double %190, %191
store double %192, double* %26
%193 = load i32, i32* %20
%194 = sext i32 %193 to i64
%195 = load i64, i64* %5
%196 = sub nsw i64 %194, %195
%197 = trunc i64 %196 to i32
%198 = call i64 @fmod(i32 %197, i32 2)
%199 = trunc i64 %198 to i32
store i32 %199, i32* %24
%200 = load i32, i32* %20
%201 = sext i32 %200 to i64
%202 = load i64, i64* %5
%203 = icmp slt i64 %201, %202
br i1 %203, label %204, label %213
204: ; preds = %94
%205 = load i32, i32* %20
store i32 %205, i32* %21
%206 = load i32, i32* %21
%207 = load i32, i32* %21
%208 = mul nsw i32 %206, %207
%209 = sitofp i32 %208 to double
%210 = load double, double* %28
%211 = fneg double %209
%212 = call double @llvm.fmuladd.f64(double %211, double %210, double 1.000000e+00)
store double %212, double* %26
store i32 0, i32* %24
br label %230
213: ; preds = %94
%214 = load i32, i32* %20
%215 = sext i32 %214 to i64
%216 = load i64, i64* %5
%217 = mul nsw i64 3, %216
%218 = icmp sgt i64 %215, %217
br i1 %218, label %219, label %229
219: ; preds = %213
%220 = load i32, i32* %25
%221 = load i32, i32* %20
%222 = sub nsw i32 %220, %221
store i32 %222, i32* %21
%223 = load i32, i32* %21
%224 = load i32, i32* %21
%225 = mul nsw i32 %223, %224
%226 = sitofp i32 %225 to double
%227 = load double, double* %28
%228 = call double @llvm.fmuladd.f64(double %226, double %227, double -1.000000e+00)
store double %228, double* %26
store i32 0, i32* %24
br label %229
229: ; preds = %219, %213
br label %230
230: ; preds = %229, %204
%231 = load double, double* %26
%232 = call double @acos(double %231)
%233 = load double*, double** %7
store double %232, double* %233
%234 = load i32, i32* %11
%235 = sext i32 %234 to i64
%236 = getelementptr inbounds [12 x i32], [12 x i32]* %33, i64 0, i64 %235
%237 = load i32, i32* %236
%238 = load i32, i32* %21
%239 = mul nsw i32 %237, %238
%240 = load i32, i32* %22
%241 = add nsw i32 %239, %240
%242 = add nsw i32 %241, 1
%243 = load i32, i32* %24
%244 = add nsw i32 %242, %243
%245 = sdiv i32 %244, 2
store i32 %245, i32* %23
%246 = load i32, i32* %23
%247 = load i32, i32* %25
%248 = icmp sgt i32 %246, %247
br i1 %248, label %249, label %253
249: ; preds = %230
%250 = load i32, i32* %23
%251 = load i32, i32* %25
%252 = sub nsw i32 %250, %251
store i32 %252, i32* %23
br label %253
253: ; preds = %249, %230
%254 = load i32, i32* %23
%255 = icmp slt i32 %254, 1
br i1 %255, label %256, label %260
256: ; preds = %253
%257 = load i32, i32* %23
%258 = load i32, i32* %25
%259 = add nsw i32 %257, %258
store i32 %259, i32* %23
br label %260
260: ; preds = %256, %253
%261 = load i32, i32* %23
%262 = sitofp i32 %261 to double
%263 = load i32, i32* %24
%264 = add nsw i32 %263, 1
%265 = sitofp i32 %264 to double
%266 = fneg double %265
%267 = call double @llvm.fmuladd.f64(double %266, double 5.000000e-01, double %262)
%268 = load double, double* %30
%269 = load i32, i32* %21
%270 = sitofp i32 %269 to double
%271 = fdiv double %268, %270
%272 = fmul double %267, %271
%273 = load double*, double** %8
store double %272, double* %273
ret void
}

LLVM IR (-O2):
@pix2ang_nest.pix2x = internal global [1024 x i32] zeroinitializer
@pix2ang_nest.pix2y = internal global [1024 x i32] zeroinitializer
@stderr = global i32 0
@.str = [34 x i8] c"%s (%d): nside out of range: %ld\0A\00"
@.str.1 = [179 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/ezralanglois/arachnid/refs/heads/master/arachnid/core/orient/core/healpix/pix2ang_nest.c\00"
@.str.2 = [33 x i8] c"%s (%d): ipix out of range: %ld\0A\00"
define void @pix2ang_nest(i64 %0, i64 %1, double* nocapture writeonly %2, double* nocapture writeonly %3) {
%5 = alloca [12 x i32]
%6 = alloca [12 x i32]
%7 = bitcast [12 x i32]* %5 to i8*
%8 = bitcast [12 x i32]* %6 to i8*
%9 = bitcast [12 x i32]* %5 to <4 x i32>*
store <4 x i32> <i32 2, i32 2, i32 2, i32 2>, <4 x i32>* %9
%10 = getelementptr inbounds [12 x i32], [12 x i32]* %5, i64 0, i64 4
%11 = bitcast i32* %10 to <4 x i32>*
store <4 x i32> <i32 3, i32 3, i32 3, i32 3>, <4 x i32>* %11
%12 = getelementptr inbounds [12 x i32], [12 x i32]* %5, i64 0, i64 8
%13 = bitcast i32* %12 to <4 x i32>*
store <4 x i32> <i32 4, i32 4, i32 4, i32 4>, <4 x i32>* %13
%14 = bitcast [12 x i32]* %6 to <4 x i32>*
store <4 x i32> <i32 1, i32 3, i32 5, i32 7>, <4 x i32>* %14
%15 = getelementptr inbounds [12 x i32], [12 x i32]* %6, i64 0, i64 4
%16 = bitcast i32* %15 to <4 x i32>*
store <4 x i32> <i32 0, i32 2, i32 4, i32 6>, <4 x i32>* %16
%17 = getelementptr inbounds [12 x i32], [12 x i32]* %6, i64 0, i64 8
%18 = bitcast i32* %17 to <4 x i32>*
store <4 x i32> <i32 1, i32 3, i32 5, i32 7>, <4 x i32>* %18
%19 = add i64 %0, -8193
%20 = icmp ult i64 %19, -8192
br i1 %20, label %21, label %25
21: ; preds = %4
%22 = load i32, i32* @stderr
%23 = tail call i32 @fprintf(i32 %22, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([179 x i8], [179 x i8]* @.str.1, i64 0, i64 0), i32 91, i64 %0)
%24 = tail call i32 @exit(i32 0)
unreachable
25: ; preds = %4
%26 = icmp slt i64 %1, 0
br i1 %26, label %33, label %27
27: ; preds = %25
%28 = mul nuw nsw i64 %0, %0
%29 = mul nuw nsw i64 %28, 12
%30 = add nuw nsw i64 %29, 4294967295
%31 = and i64 %30, 4294967295
%32 = icmp ult i64 %31, %1
br i1 %32, label %33, label %37
33: ; preds = %27, %25
%34 = load i32, i32* @stderr
%35 = tail call i32 @fprintf(i32 %34, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([179 x i8], [179 x i8]* @.str.1, i64 0, i64 0), i32 96, i64 %1)
%36 = tail call i32 @exit(i32 0)
unreachable
37: ; preds = %27
%38 = load i32, i32* getelementptr inbounds ([1024 x i32], [1024 x i32]* @pix2ang_nest.pix2x, i64 0, i64 1023)
%39 = icmp slt i32 %38, 1
br i1 %39, label %40, label %42
40: ; preds = %37
%41 = tail call i32 @mk_pix2xy(i32* getelementptr inbounds ([1024 x i32], [1024 x i32]* @pix2ang_nest.pix2x, i64 0, i64 0), i32* getelementptr inbounds ([1024 x i32], [1024 x i32]* @pix2ang_nest.pix2y, i64 0, i64 0))
br label %42
42: ; preds = %40, %37
%43 = sitofp i64 %0 to double
%44 = fmul double %43, 3.000000e+00
%45 = fmul double %44, %43
%46 = fdiv double 1.000000e+00, %45
%47 = trunc i64 %0 to i32
%48 = shl nuw nsw i32 %47, 2
%49 = trunc i64 %28 to i32
%50 = udiv i64 %1, %28
%51 = trunc i64 %1 to i32
%52 = tail call i64 @fmod(i32 %51, i32 %49)
%53 = trunc i64 %52 to i32
%54 = tail call i64 @fmod(i32 %53, i32 1024)
%55 = sdiv i32 %53, 1024
%56 = tail call i64 @fmod(i32 %55, i32 1024)
%57 = sdiv i32 %53, 1048576
%58 = sext i32 %57 to i64
%59 = getelementptr inbounds [1024 x i32], [1024 x i32]* @pix2ang_nest.pix2x, i64 0, i64 %58
%60 = load i32, i32* %59
%61 = shl nsw i32 %60, 10
%62 = shl i64 %56, 32
%63 = ashr exact i64 %62, 32
%64 = getelementptr inbounds [1024 x i32], [1024 x i32]* @pix2ang_nest.pix2x, i64 0, i64 %63
%65 = load i32, i32* %64
%66 = shl nsw i32 %65, 5
%67 = add nsw i32 %66, %61
%68 = shl i64 %54, 32
%69 = ashr exact i64 %68, 32
%70 = getelementptr inbounds [1024 x i32], [1024 x i32]* @pix2ang_nest.pix2x, i64 0, i64 %69
%71 = load i32, i32* %70
%72 = add nsw i32 %67, %71
%73 = getelementptr inbounds [1024 x i32], [1024 x i32]* @pix2ang_nest.pix2y, i64 0, i64 %58
%74 = load i32, i32* %73
%75 = shl nsw i32 %74, 10
%76 = getelementptr inbounds [1024 x i32], [1024 x i32]* @pix2ang_nest.pix2y, i64 0, i64 %63
%77 = load i32, i32* %76
%78 = shl nsw i32 %77, 5
%79 = add nsw i32 %78, %75
%80 = getelementptr inbounds [1024 x i32], [1024 x i32]* @pix2ang_nest.pix2y, i64 0, i64 %69
%81 = load i32, i32* %80
%82 = add nsw i32 %79, %81
%83 = add nsw i32 %82, %72
%84 = and i64 %50, 4294967295
%85 = getelementptr inbounds [12 x i32], [12 x i32]* %5, i64 0, i64 %84
%86 = load i32, i32* %85
%87 = xor i32 %83, -1
%88 = mul i32 %86, %47
%89 = add i32 %88, %87
%90 = sext i32 %89 to i64
%91 = sub i32 %89, %47
%92 = tail call i64 @fmod(i32 %91, i32 2)
%93 = icmp slt i64 %90, %0
br i1 %93, label %94, label %99
94: ; preds = %42
%95 = mul nsw i32 %89, %89
%96 = sitofp i32 %95 to double
%97 = fneg double %96
%98 = tail call double @llvm.fmuladd.f64(double %97, double %46, double 1.000000e+00)
br label %113
99: ; preds = %42
%100 = trunc i64 %92 to i32
%101 = shl nuw nsw i64 %0, 1
%102 = sub nsw i64 %101, %90
%103 = sitofp i64 %102 to double
%104 = fdiv double 2.000000e+00, %44
%105 = fmul double %104, %103
%106 = mul nuw nsw i64 %0, 3
%107 = icmp slt i64 %106, %90
br i1 %107, label %108, label %113
108: ; preds = %99
%109 = sub nsw i32 %48, %89
%110 = mul nsw i32 %109, %109
%111 = sitofp i32 %110 to double
%112 = tail call double @llvm.fmuladd.f64(double %111, double %46, double -1.000000e+00)
br label %113
113: ; preds = %99, %108, %94
%114 = phi double [ %98, %94 ], [ %112, %108 ], [ %105, %99 ]
%115 = phi i32 [ 0, %94 ], [ 0, %108 ], [ %100, %99 ]
%116 = phi i32 [ %89, %94 ], [ %109, %108 ], [ %47, %99 ]
%117 = tail call double @acos(double %114)
store double %117, double* %2
%118 = getelementptr inbounds [12 x i32], [12 x i32]* %6, i64 0, i64 %84
%119 = load i32, i32* %118
%120 = mul nsw i32 %119, %116
%121 = add i32 %115, 1
%122 = add i32 %121, %72
%123 = sub i32 %122, %82
%124 = add i32 %123, %120
%125 = sdiv i32 %124, 2
%126 = icmp sgt i32 %125, %48
%127 = select i1 %126, i32 %48, i32 0
%128 = sub nsw i32 %125, %127
%129 = icmp sgt i32 %128, 0
%130 = select i1 %129, i32 0, i32 %48
%131 = add nsw i32 %130, %128
%132 = sitofp i32 %131 to double
%133 = sitofp i32 %121 to double
%134 = fneg double %133
%135 = tail call double @llvm.fmuladd.f64(double %134, double 5.000000e-01, double %132)
%136 = sitofp i32 %116 to double
%137 = fdiv double 0x3FF921FB54442D18, %136
%138 = fmul double %137, %135
store double %138, double* %3
ret void
}