#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(int);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
double floor(double);
int fmod(double, int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, int, long);
double sqrt(double);
int /*<<< orphan*/ stderr;
void pix2ang_ring(long nside, long ipix, double *theta, double *phi) {
  int nl2, nl4, npix, ncap, iring, iphi, ip, ipix1;
  double fact1, fact2, fodd, hip, fihip;
  double PI = 3.14159265358979323846;
  int ns_max = 8192;
  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_ring.c",
            54, 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_ring.c",
            59, ipix);
    exit(0);
  }
  ipix1 = ipix + 1;
  nl2 = 2 * nside;
  nl4 = 4 * nside;
  ncap = 2 * nside * (nside - 1);
  fact1 = 1.5 * nside;
  fact2 = 3.0 * nside * nside;
  if (ipix1 <= ncap) {
    hip = ipix1 / 2.;
    fihip = floor(hip);
    iring = (int)floor(sqrt(hip - sqrt(fihip))) + 1;
    iphi = ipix1 - 2 * iring * (iring - 1);
    *theta = acos(1. - iring * iring / fact2);
    *phi = (1. * iphi - 0.5) * PI / (2. * iring);
  } else if (ipix1 <= nl2 * (5 * nside + 1)) {
    ip = ipix1 - ncap - 1;
    iring = (int)floor(ip / nl4) + nside;
    iphi = (int)fmod(ip, nl4) + 1;
    fodd = 0.5 * (1 + fmod((double)(iring + nside), 2));
    *theta = acos((nl2 - iring) / fact1);
    *phi = (1. * iphi - fodd) * PI / (2. * nside);
  } else {
    ip = npix - ipix1 + 1;
    hip = ip / 2.;
    fihip = floor(hip);
    iring = (int)floor(sqrt(hip - sqrt(fihip))) + 1;
    iphi = (int)(4. * iring + 1 - (ip - 2. * iring * (iring - 1)));
    *theta = acos(-1. + iring * iring / fact2);
    *phi = (1. * iphi - 0.5) * PI / (2. * iring);
  }
}


x86 assembly (clang, -O0):
<pix2ang_ring>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
movsd  0xe7d(%rip),%xmm0
movsd  %xmm0,-0x70(%rbp)
movl   $0x2000,-0x74(%rbp)
cmpq   $0x1,-0x8(%rbp)
jl     11ab <pix2ang_ring+0x4b>
mov    -0x8(%rbp),%rax
movslq -0x74(%rbp),%rcx
cmp    %rcx,%rax
jle    11d7 <pix2ang_ring+0x77>
mov    0x2e2e(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%r8
lea    0xe89(%rip),%rsi
lea    0xea4(%rip),%rdx
mov    $0x36,%ecx
call   1050 <fprintf@plt>
xor    %edi,%edi
call   1070 <exit@plt>
imul   $0xc,-0x8(%rbp),%rax
imul   -0x8(%rbp),%rax
mov    %eax,-0x2c(%rbp)
cmpq   $0x0,-0x10(%rbp)
jl     1205 <pix2ang_ring+0xa5>
mov    -0x10(%rbp),%rax
mov    -0x2c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
cmp    %rcx,%rax
jle    1231 <pix2ang_ring+0xd1>
mov    0x2dd4(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%r8
lea    0xf04(%rip),%rsi
lea    0xe4a(%rip),%rdx
mov    $0x3b,%ecx
call   1050 <fprintf@plt>
xor    %edi,%edi
call   1070 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %eax,-0x40(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x1,%rax
mov    %eax,-0x24(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x2,%rax
mov    %eax,-0x28(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x1,%rax
mov    -0x8(%rbp),%rcx
sub    $0x1,%rcx
imul   %rcx,%rax
mov    %eax,-0x30(%rbp)
cvtsi2sdq -0x8(%rbp),%xmm1
movsd  0xd99(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
cvtsi2sdq -0x8(%rbp),%xmm1
movsd  0xd7a(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsi2sdq -0x8(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x40(%rbp),%eax
cmp    -0x30(%rbp),%eax
jg     1382 <pix2ang_ring+0x222>
cvtsi2sdl -0x40(%rbp),%xmm0
movsd  0xd5e(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x60(%rbp),%xmm0
call   1080 <floor@plt>
movsd  %xmm0,-0x68(%rbp)
movsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x68(%rbp),%xmm0
call   1060 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x80(%rbp),%xmm0
subsd  %xmm1,%xmm0
call   1060 <sqrt@plt>
call   1080 <floor@plt>
cvttsd2si %xmm0,%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
mov    -0x40(%rbp),%eax
mov    -0x34(%rbp),%ecx
shl    $0x1,%ecx
mov    -0x34(%rbp),%edx
sub    $0x1,%edx
imul   %edx,%ecx
sub    %ecx,%eax
mov    %eax,-0x38(%rbp)
mov    -0x34(%rbp),%eax
imul   -0x34(%rbp),%eax
cvtsi2sd %eax,%xmm1
divsd  -0x50(%rbp),%xmm1
movsd  0xd03(%rip),%xmm0
subsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1040 <acos@plt>
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
cvtsi2sdl -0x38(%rbp),%xmm0
movsd  0xcc9(%rip),%xmm1
addsd  %xmm1,%xmm0
mulsd  -0x70(%rbp),%xmm0
cvtsi2sdl -0x34(%rbp),%xmm2
movsd  0xcab(%rip),%xmm1
mulsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    15af <pix2ang_ring+0x44f>
movslq -0x40(%rbp),%rax
movslq -0x24(%rbp),%rcx
imul   $0x5,-0x8(%rbp),%rdx
add    $0x1,%rdx
imul   %rdx,%rcx
cmp    %rcx,%rax
jg     1478 <pix2ang_ring+0x318>
mov    -0x40(%rbp),%eax
sub    -0x30(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
cltd
idivl  -0x28(%rbp)
cvtsi2sd %eax,%xmm0
call   1080 <floor@plt>
cvttsd2si %xmm0,%eax
cltq
add    -0x8(%rbp),%rax
mov    %eax,-0x34(%rbp)
cvtsi2sdl -0x3c(%rbp),%xmm0
mov    -0x28(%rbp),%edi
call   1030 <fmod@plt>
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
movslq -0x34(%rbp),%rax
add    -0x8(%rbp),%rax
cvtsi2sd %rax,%xmm0
mov    $0x2,%edi
call   1030 <fmod@plt>
add    $0x1,%eax
cvtsi2sd %eax,%xmm1
movsd  0xc3e(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    -0x24(%rbp),%eax
sub    -0x34(%rbp),%eax
cvtsi2sd %eax,%xmm0
divsd  -0x48(%rbp),%xmm0
cvttsd2si %xmm0,%edi
call   1040 <acos@plt>
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
cvtsi2sdl -0x38(%rbp),%xmm0
movsd  -0x58(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
addsd  %xmm1,%xmm0
mulsd  -0x70(%rbp),%xmm0
cvtsi2sdq -0x8(%rbp),%xmm2
movsd  0xbb5(%rip),%xmm1
mulsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    15aa <pix2ang_ring+0x44a>
mov    -0x2c(%rbp),%eax
sub    -0x40(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
cvtsi2sdl -0x3c(%rbp),%xmm0
movsd  0xb87(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x60(%rbp),%xmm0
call   1080 <floor@plt>
movsd  %xmm0,-0x68(%rbp)
movsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x68(%rbp),%xmm0
call   1060 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x88(%rbp),%xmm0
ff
subsd  %xmm1,%xmm0
call   1060 <sqrt@plt>
call   1080 <floor@plt>
cvttsd2si %xmm0,%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
cvtsi2sdl -0x34(%rbp),%xmm0
movsd  0xb40(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xb3c(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsi2sdl -0x3c(%rbp),%xmm2
cvtsi2sdl -0x34(%rbp),%xmm3
movsd  0xb06(%rip),%xmm1
mulsd  %xmm3,%xmm1
mov    -0x34(%rbp),%eax
sub    $0x1,%eax
cvtsi2sd %eax,%xmm3
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
subsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x38(%rbp)
mov    -0x34(%rbp),%eax
imul   -0x34(%rbp),%eax
cvtsi2sd %eax,%xmm1
divsd  -0x50(%rbp),%xmm1
movsd  0xac6(%rip),%xmm0
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1040 <acos@plt>
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
cvtsi2sdl -0x38(%rbp),%xmm0
movsd  0xa9c(%rip),%xmm1
addsd  %xmm1,%xmm0
mulsd  -0x70(%rbp),%xmm0
cvtsi2sdl -0x34(%rbp),%xmm2
movsd  0xa7e(%rip),%xmm1
mulsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    15af <pix2ang_ring+0x44f>
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pix2ang_ring>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    %rdi,%rbx
lea    -0x2001(%rdi),%rax
cmp    $0xffffffffffffdfff,%rax
jbe    14a9 <pix2ang_ring+0x349>
mov    %rsi,%r8
test   %rsi,%rsi
js     148b <pix2ang_ring+0x32b>
mov    %rcx,%r14
mov    %rbx,%rax
imul   %rbx,%rax
shl    $0x2,%rax
lea    (%rax,%rax,2),%rax
lea    -0x1(%rax),%ecx
cmp    %r8,%rcx
jb     148b <pix2ang_ring+0x32b>
mov    %rdx,%r15
lea    0x1(%r8),%ebp
lea    (%rbx,%rbx,1),%r13
lea    -0x1(%rbx),%ecx
imul   %r13d,%ecx
cvtsi2sd %rbx,%xmm1
movsd  0xe3b(%rip),%xmm0
mulsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm0
cmp    %ecx,%ebp
jle    1237 <pix2ang_ring+0xd7>
movslq %ebp,%rdx
mov    %r13d,%esi
and    $0xfffffffe,%esi
lea    (%rbx,%rbx,4),%rdi
add    $0x1,%rdi
imul   %rsi,%rdi
cmp    %rdx,%rdi
jge    126e <pix2ang_ring+0x10e>
movsd  %xmm0,0x8(%rsp)
sub    %r8d,%eax
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
movsd  0xe05(%rip),%xmm0
movsd  %xmm1,0x10(%rsp)
mulsd  %xmm1,%xmm0
movsd  %xmm0,0x20(%rsp)
call   1080 <floor@plt>
xorpd  %xmm2,%xmm2
ucomisd %xmm2,%xmm0
jb     13b8 <pix2ang_ring+0x258>
sqrtsd %xmm0,%xmm0
jmp    13c1 <pix2ang_ring+0x261>
movsd  %xmm0,0x8(%rsp)
xorps  %xmm0,%xmm0
cvtsi2sd %ebp,%xmm0
mulsd  0xdc4(%rip),%xmm0
movsd  %xmm0,0x10(%rsp)
call   1080 <floor@plt>
xorpd  %xmm2,%xmm2
ucomisd %xmm2,%xmm0
jb     1326 <pix2ang_ring+0x1c6>
sqrtsd %xmm0,%xmm0
jmp    132f <pix2ang_ring+0x1cf>
lea    0x0(,%rbx,4),%edi
movsd  0xd83(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,0x10(%rsp)
sub    %ecx,%r8d
mov    %r8d,%eax
cltd
idiv   %edi
mov    %eax,%ebp
add    %ebx,%ebp
xorps  %xmm0,%xmm0
cvtsi2sd %r8d,%xmm0
movsd  %xmm1,0x8(%rsp)
call   1030 <fmod@plt>
mov    %eax,%r12d
add    $0x1,%r12d
movslq %ebp,%rbp
add    %rbp,%rbx
xorps  %xmm0,%xmm0
cvtsi2sd %rbx,%xmm0
mov    $0x2,%edi
call   1030 <fmod@plt>
add    $0x1,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movapd %xmm0,0x20(%rsp)
sub    %ebp,%r13d
xorps  %xmm0,%xmm0
cvtsi2sd %r13d,%xmm0
divsd  0x10(%rsp),%xmm0
cvttsd2si %xmm0,%edi
call   1040 <acos@plt>
xorps  %xmm1,%xmm1
cvtsi2sd %r12d,%xmm1
movsd  %xmm0,(%r15)
movapd 0x20(%rsp),%xmm0
mulsd  0xd15(%rip),%xmm0
addsd  %xmm1,%xmm0
movapd %xmm0,%xmm1
mulsd  0xd0d(%rip),%xmm1
movsd  0x8(%rsp),%xmm0
jmp    13ab <pix2ang_ring+0x24b>
call   1060 <sqrt@plt>
xorpd  %xmm2,%xmm2
movsd  0x10(%rsp),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
ucomisd %xmm2,%xmm1
jb     1349 <pix2ang_ring+0x1e9>
sqrtsd %xmm0,%xmm0
jmp    134e <pix2ang_ring+0x1ee>
call   1060 <sqrt@plt>
call   1080 <floor@plt>
cvttsd2si %xmm0,%eax
lea    0x1(%rax),%ebx
imul   %ebx,%eax
add    %eax,%eax
sub    %eax,%ebp
mov    %ebx,%eax
imul   %ebx,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
divsd  0x8(%rsp),%xmm0
movsd  0xc9d(%rip),%xmm1
subsd  %xmm0,%xmm1
cvttsd2si %xmm1,%edi
call   1040 <acos@plt>
movsd  %xmm0,(%r15)
xorps  %xmm1,%xmm1
cvtsi2sd %ebp,%xmm1
addsd  0xc84(%rip),%xmm1
mulsd  0xc84(%rip),%xmm1
xorps  %xmm0,%xmm0
cvtsi2sd %ebx,%xmm0
addsd  %xmm0,%xmm0
divsd  %xmm0,%xmm1
jmp    1477 <pix2ang_ring+0x317>
call   1060 <sqrt@plt>
xorpd  %xmm2,%xmm2
movsd  0x20(%rsp),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
ucomisd %xmm2,%xmm1
jb     13db <pix2ang_ring+0x27b>
sqrtsd %xmm0,%xmm0
jmp    13e0 <pix2ang_ring+0x280>
call   1060 <sqrt@plt>
call   1080 <floor@plt>
cvttsd2si %xmm0,%eax
add    $0x1,%eax
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
movsd  0xc35(%rip),%xmm2
mulsd  %xmm1,%xmm2
addsd  0xc11(%rip),%xmm2
cvttpd2dq %xmm0,%xmm0
cvtdq2pd %xmm0,%xmm0
addsd  %xmm1,%xmm1
movsd  %xmm1,0x20(%rsp)
mulsd  %xmm1,%xmm0
movsd  0x10(%rsp),%xmm1
subsd  %xmm0,%xmm1
subsd  %xmm1,%xmm2
movapd %xmm2,0x10(%rsp)
imul   %eax,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
divsd  0x8(%rsp),%xmm0
addsd  0xbef(%rip),%xmm0
cvttsd2si %xmm0,%edi
call   1040 <acos@plt>
cvttpd2dq 0x10(%rsp),%xmm1
cvtdq2pd %xmm1,%xmm1
addsd  0xbbc(%rip),%xmm1
movsd  %xmm0,(%r15)
mulsd  0xbb7(%rip),%xmm1
divsd  0x20(%rsp),%xmm1
movsd  %xmm1,(%r14)
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2b4e(%rip),%rax
mov    (%rax),%edi
lea    0xc7a(%rip),%rsi
lea    0xbc0(%rip),%rdx
mov    $0x3b,%ecx
jmp    14c8 <pix2ang_ring+0x368>
mov    0x2b30(%rip),%rax
mov    (%rax),%edi
lea    0xb87(%rip),%rsi
lea    0xba2(%rip),%rdx
mov    $0x36,%ecx
mov    %rbx,%r8
call   1050 <fprintf@plt>
xor    %edi,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@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_ring.c\00"
@.str.2 = [33 x i8] c"%s (%d): ipix out of range: %ld\0A\00"
define void @pix2ang_ring(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 double
%18 = alloca double
%19 = alloca double
%20 = alloca double
%21 = alloca double
%22 = alloca double
%23 = alloca i32
store i64 %0, i64* %5
store i64 %1, i64* %6
store double* %2, double** %7
store double* %3, double** %8
store double 0x400921FB54442D18, double* %22
store i32 8192, i32* %23
%24 = load i64, i64* %5
%25 = icmp slt i64 %24, 1
br i1 %25, label %31, label %26
26: ; preds = %4
%27 = load i64, i64* %5
%28 = load i32, i32* %23
%29 = sext i32 %28 to i64
%30 = icmp sgt i64 %27, %29
br i1 %30, label %31, label %36
31: ; preds = %26, %4
%32 = load i32, i32* @stderr
%33 = load i64, i64* %5
%34 = call i32 @fprintf(i32 %32, 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 54, i64 %33)
%35 = call i32 @exit(i32 0)
unreachable
36: ; preds = %26
%37 = load i64, i64* %5
%38 = mul nsw i64 12, %37
%39 = load i64, i64* %5
%40 = mul nsw i64 %38, %39
%41 = trunc i64 %40 to i32
store i32 %41, i32* %11
%42 = load i64, i64* %6
%43 = icmp slt i64 %42, 0
br i1 %43, label %50, label %44
44: ; preds = %36
%45 = load i64, i64* %6
%46 = load i32, i32* %11
%47 = sub nsw i32 %46, 1
%48 = sext i32 %47 to i64
%49 = icmp sgt i64 %45, %48
br i1 %49, label %50, label %55
50: ; preds = %44, %36
%51 = load i32, i32* @stderr
%52 = load i64, i64* %6
%53 = call i32 @fprintf(i32 %51, 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 59, i64 %52)
%54 = call i32 @exit(i32 0)
unreachable
55: ; preds = %44
%56 = load i64, i64* %6
%57 = add nsw i64 %56, 1
%58 = trunc i64 %57 to i32
store i32 %58, i32* %16
%59 = load i64, i64* %5
%60 = mul nsw i64 2, %59
%61 = trunc i64 %60 to i32
store i32 %61, i32* %9
%62 = load i64, i64* %5
%63 = mul nsw i64 4, %62
%64 = trunc i64 %63 to i32
store i32 %64, i32* %10
%65 = load i64, i64* %5
%66 = mul nsw i64 2, %65
%67 = load i64, i64* %5
%68 = sub nsw i64 %67, 1
%69 = mul nsw i64 %66, %68
%70 = trunc i64 %69 to i32
store i32 %70, i32* %12
%71 = load i64, i64* %5
%72 = sitofp i64 %71 to double
%73 = fmul double 1.500000e+00, %72
store double %73, double* %17
%74 = load i64, i64* %5
%75 = sitofp i64 %74 to double
%76 = fmul double 3.000000e+00, %75
%77 = load i64, i64* %5
%78 = sitofp i64 %77 to double
%79 = fmul double %76, %78
store double %79, double* %18
%80 = load i32, i32* %16
%81 = load i32, i32* %12
%82 = icmp sle i32 %80, %81
br i1 %82, label %83, label %124
83: ; preds = %55
%84 = load i32, i32* %16
%85 = sitofp i32 %84 to double
%86 = fdiv double %85, 2.000000e+00
store double %86, double* %20
%87 = load double, double* %20
%88 = call double @llvm.floor.f64(double %87)
store double %88, double* %21
%89 = load double, double* %20
%90 = load double, double* %21
%91 = call double @sqrt(double %90)
%92 = fsub double %89, %91
%93 = call double @sqrt(double %92)
%94 = call double @llvm.floor.f64(double %93)
%95 = fptosi double %94 to i32
%96 = add nsw i32 %95, 1
store i32 %96, i32* %13
%97 = load i32, i32* %16
%98 = load i32, i32* %13
%99 = mul nsw i32 2, %98
%100 = load i32, i32* %13
%101 = sub nsw i32 %100, 1
%102 = mul nsw i32 %99, %101
%103 = sub nsw i32 %97, %102
store i32 %103, i32* %14
%104 = load i32, i32* %13
%105 = load i32, i32* %13
%106 = mul nsw i32 %104, %105
%107 = sitofp i32 %106 to double
%108 = load double, double* %18
%109 = fdiv double %107, %108
%110 = fsub double 1.000000e+00, %109
%111 = fptosi double %110 to i32
%112 = call double @acos(i32 %111)
%113 = load double*, double** %7
store double %112, double* %113
%114 = load i32, i32* %14
%115 = sitofp i32 %114 to double
%116 = call double @llvm.fmuladd.f64(double 1.000000e+00, double %115, double -5.000000e-01)
%117 = load double, double* %22
%118 = fmul double %116, %117
%119 = load i32, i32* %13
%120 = sitofp i32 %119 to double
%121 = fmul double 2.000000e+00, %120
%122 = fdiv double %118, %121
%123 = load double*, double** %8
store double %122, double* %123
br label %238
124: ; preds = %55
%125 = load i32, i32* %16
%126 = sext i32 %125 to i64
%127 = load i32, i32* %9
%128 = sext i32 %127 to i64
%129 = load i64, i64* %5
%130 = mul nsw i64 5, %129
%131 = add nsw i64 %130, 1
%132 = mul nsw i64 %128, %131
%133 = icmp sle i64 %126, %132
br i1 %133, label %134, label %184
134: ; preds = %124
%135 = load i32, i32* %16
%136 = load i32, i32* %12
%137 = sub nsw i32 %135, %136
%138 = sub nsw i32 %137, 1
store i32 %138, i32* %15
%139 = load i32, i32* %15
%140 = load i32, i32* %10
%141 = sdiv i32 %139, %140
%142 = sitofp i32 %141 to double
%143 = call double @llvm.floor.f64(double %142)
%144 = fptosi double %143 to i32
%145 = sext i32 %144 to i64
%146 = load i64, i64* %5
%147 = add nsw i64 %145, %146
%148 = trunc i64 %147 to i32
store i32 %148, i32* %13
%149 = load i32, i32* %15
%150 = sitofp i32 %149 to double
%151 = load i32, i32* %10
%152 = call i32 @fmod(double %150, i32 %151)
%153 = add nsw i32 %152, 1
store i32 %153, i32* %14
%154 = load i32, i32* %13
%155 = sext i32 %154 to i64
%156 = load i64, i64* %5
%157 = add nsw i64 %155, %156
%158 = sitofp i64 %157 to double
%159 = call i32 @fmod(double %158, i32 2)
%160 = add nsw i32 1, %159
%161 = sitofp i32 %160 to double
%162 = fmul double 5.000000e-01, %161
store double %162, double* %19
%163 = load i32, i32* %9
%164 = load i32, i32* %13
%165 = sub nsw i32 %163, %164
%166 = sitofp i32 %165 to double
%167 = load double, double* %17
%168 = fdiv double %166, %167
%169 = fptosi double %168 to i32
%170 = call double @acos(i32 %169)
%171 = load double*, double** %7
store double %170, double* %171
%172 = load i32, i32* %14
%173 = sitofp i32 %172 to double
%174 = load double, double* %19
%175 = fneg double %174
%176 = call double @llvm.fmuladd.f64(double 1.000000e+00, double %173, double %175)
%177 = load double, double* %22
%178 = fmul double %176, %177
%179 = load i64, i64* %5
%180 = sitofp i64 %179 to double
%181 = fmul double 2.000000e+00, %180
%182 = fdiv double %178, %181
%183 = load double*, double** %8
store double %182, double* %183
br label %237
184: ; preds = %124
%185 = load i32, i32* %11
%186 = load i32, i32* %16
%187 = sub nsw i32 %185, %186
%188 = add nsw i32 %187, 1
store i32 %188, i32* %15
%189 = load i32, i32* %15
%190 = sitofp i32 %189 to double
%191 = fdiv double %190, 2.000000e+00
store double %191, double* %20
%192 = load double, double* %20
%193 = call double @llvm.floor.f64(double %192)
store double %193, double* %21
%194 = load double, double* %20
%195 = load double, double* %21
%196 = call double @sqrt(double %195)
%197 = fsub double %194, %196
%198 = call double @sqrt(double %197)
%199 = call double @llvm.floor.f64(double %198)
%200 = fptosi double %199 to i32
%201 = add nsw i32 %200, 1
store i32 %201, i32* %13
%202 = load i32, i32* %13
%203 = sitofp i32 %202 to double
%204 = call double @llvm.fmuladd.f64(double 4.000000e+00, double %203, double 1.000000e+00)
%205 = load i32, i32* %15
%206 = sitofp i32 %205 to double
%207 = load i32, i32* %13
%208 = sitofp i32 %207 to double
%209 = fmul double 2.000000e+00, %208
%210 = load i32, i32* %13
%211 = sub nsw i32 %210, 1
%212 = sitofp i32 %211 to double
%213 = fneg double %209
%214 = call double @llvm.fmuladd.f64(double %213, double %212, double %206)
%215 = fsub double %204, %214
%216 = fptosi double %215 to i32
store i32 %216, i32* %14
%217 = load i32, i32* %13
%218 = load i32, i32* %13
%219 = mul nsw i32 %217, %218
%220 = sitofp i32 %219 to double
%221 = load double, double* %18
%222 = fdiv double %220, %221
%223 = fadd double -1.000000e+00, %222
%224 = fptosi double %223 to i32
%225 = call double @acos(i32 %224)
%226 = load double*, double** %7
store double %225, double* %226
%227 = load i32, i32* %14
%228 = sitofp i32 %227 to double
%229 = call double @llvm.fmuladd.f64(double 1.000000e+00, double %228, double -5.000000e-01)
%230 = load double, double* %22
%231 = fmul double %229, %230
%232 = load i32, i32* %13
%233 = sitofp i32 %232 to double
%234 = fmul double 2.000000e+00, %233
%235 = fdiv double %231, %234
%236 = load double*, double** %8
store double %235, double* %236
br label %237
237: ; preds = %184, %134
br label %238
238: ; preds = %237, %83
ret void
}

LLVM IR (-O2):
@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_ring.c\00"
@.str.2 = [33 x i8] c"%s (%d): ipix out of range: %ld\0A\00"
define void @pix2ang_ring(i64 %0, i64 %1, double* nocapture writeonly %2, double* nocapture writeonly %3) {
%5 = add i64 %0, -8193
%6 = icmp ult i64 %5, -8192
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = load i32, i32* @stderr
%9 = tail call i32 @fprintf(i32 %8, 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 54, i64 %0)
%10 = tail call i32 @exit(i32 0)
unreachable
11: ; preds = %4
%12 = mul nuw nsw i64 %0, 12
%13 = mul nuw nsw i64 %12, %0
%14 = trunc i64 %13 to i32
%15 = icmp slt i64 %1, 0
br i1 %15, label %20, label %16
16: ; preds = %11
%17 = add nuw nsw i64 %13, 4294967295
%18 = and i64 %17, 4294967295
%19 = icmp ult i64 %18, %1
br i1 %19, label %20, label %24
20: ; preds = %16, %11
%21 = load i32, i32* @stderr
%22 = tail call i32 @fprintf(i32 %21, 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 59, i64 %1)
%23 = tail call i32 @exit(i32 0)
unreachable
24: ; preds = %16
%25 = trunc i64 %1 to i32
%26 = add i32 %25, 1
%27 = shl nuw nsw i64 %0, 1
%28 = trunc i64 %27 to i32
%29 = trunc i64 %0 to i32
%30 = shl nuw nsw i32 %29, 2
%31 = add nsw i64 %0, -1
%32 = mul nuw nsw i64 %27, %31
%33 = trunc i64 %32 to i32
%34 = sitofp i64 %0 to double
%35 = fmul double %34, 1.500000e+00
%36 = fmul double %34, 3.000000e+00
%37 = fmul double %36, %34
%38 = icmp sgt i32 %26, %33
br i1 %38, label %64, label %39
39: ; preds = %24
%40 = sitofp i32 %26 to double
%41 = fmul double %40, 5.000000e-01
%42 = tail call double @llvm.floor.f64(double %41)
%43 = tail call double @sqrt(double %42)
%44 = fsub double %41, %43
%45 = tail call double @sqrt(double %44)
%46 = tail call double @llvm.floor.f64(double %45)
%47 = fptosi double %46 to i32
%48 = add nsw i32 %47, 1
%49 = mul i32 %47, -2
%50 = mul i32 %49, %48
%51 = add i32 %50, %26
%52 = mul nsw i32 %48, %48
%53 = sitofp i32 %52 to double
%54 = fdiv double %53, %37
%55 = fsub double 1.000000e+00, %54
%56 = fptosi double %55 to i32
%57 = tail call double @acos(i32 %56)
store double %57, double* %2
%58 = sitofp i32 %51 to double
%59 = fadd double %58, -5.000000e-01
%60 = fmul double %59, 0x400921FB54442D18
%61 = sitofp i32 %48 to double
%62 = fmul double %61, 2.000000e+00
%63 = fdiv double %60, %62
br label %124
64: ; preds = %24
%65 = sext i32 %26 to i64
%66 = and i64 %27, 4294967294
%67 = mul nuw nsw i64 %0, 5
%68 = add nuw nsw i64 %67, 1
%69 = mul nuw nsw i64 %66, %68
%70 = icmp slt i64 %69, %65
br i1 %70, label %95, label %71
71: ; preds = %64
%72 = sub i32 %25, %33
%73 = sdiv i32 %72, %30
%74 = add nsw i32 %73, %29
%75 = sitofp i32 %72 to double
%76 = tail call i32 @fmod(double %75, i32 %30)
%77 = add nsw i32 %76, 1
%78 = sext i32 %74 to i64
%79 = add nsw i64 %78, %0
%80 = sitofp i64 %79 to double
%81 = tail call i32 @fmod(double %80, i32 2)
%82 = add nsw i32 %81, 1
%83 = sitofp i32 %82 to double
%84 = sub nsw i32 %28, %74
%85 = sitofp i32 %84 to double
%86 = fdiv double %85, %35
%87 = fptosi double %86 to i32
%88 = tail call double @acos(i32 %87)
store double %88, double* %2
%89 = sitofp i32 %77 to double
%90 = fmul double %83, 5.000000e-01
%91 = fsub double %89, %90
%92 = fmul double %91, 0x400921FB54442D18
%93 = fmul double %34, 2.000000e+00
%94 = fdiv double %92, %93
br label %124
95: ; preds = %64
%96 = sub i32 %14, %25
%97 = sitofp i32 %96 to double
%98 = fmul double %97, 5.000000e-01
%99 = tail call double @llvm.floor.f64(double %98)
%100 = tail call double @sqrt(double %99)
%101 = fsub double %98, %100
%102 = tail call double @sqrt(double %101)
%103 = tail call double @llvm.floor.f64(double %102)
%104 = fptosi double %103 to i32
%105 = add nsw i32 %104, 1
%106 = sitofp i32 %105 to double
%107 = tail call double @llvm.fmuladd.f64(double %106, double 4.000000e+00, double 1.000000e+00)
%108 = fmul double %106, 2.000000e+00
%109 = sitofp i32 %104 to double
%110 = fneg double %108
%111 = tail call double @llvm.fmuladd.f64(double %110, double %109, double %97)
%112 = fsub double %107, %111
%113 = fptosi double %112 to i32
%114 = mul nsw i32 %105, %105
%115 = sitofp i32 %114 to double
%116 = fdiv double %115, %37
%117 = fadd double %116, -1.000000e+00
%118 = fptosi double %117 to i32
%119 = tail call double @acos(i32 %118)
store double %119, double* %2
%120 = sitofp i32 %113 to double
%121 = fadd double %120, -5.000000e-01
%122 = fmul double %121, 0x400921FB54442D18
%123 = fdiv double %122, %108
br label %124
124: ; preds = %71, %95, %39
%125 = phi double [ %94, %71 ], [ %123, %95 ], [ %63, %39 ]
store double %125, double* %3
ret void
}