#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 M_PI;
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 = M_PI;
  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/bkloppenborg/simtoi/refs/heads/master/"
            "lib/chealpix/pix2ang_ring.c",
            50, 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/bkloppenborg/simtoi/refs/heads/master/"
            "lib/chealpix/pix2ang_ring.c",
            55, 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)
mov    0x2e66(%rip),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x70(%rbp)
movl   $0x2000,-0x74(%rbp)
cmpq   $0x1,-0x8(%rbp)
jl     11ae <pix2ang_ring+0x4e>
mov    -0x8(%rbp),%rax
movslq -0x74(%rbp),%rcx
cmp    %rcx,%rax
jle    11da <pix2ang_ring+0x7a>
mov    0x2e23(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%r8
lea    0xe7e(%rip),%rsi
lea    0xe99(%rip),%rdx
mov    $0x32,%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     1208 <pix2ang_ring+0xa8>
mov    -0x10(%rbp),%rax
mov    -0x2c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
cmp    %rcx,%rax
jle    1234 <pix2ang_ring+0xd4>
mov    0x2dc9(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%r8
lea    0xee2(%rip),%rsi
lea    0xe3f(%rip),%rdx
mov    $0x37,%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  0xd8e(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
cvtsi2sdq -0x8(%rbp),%xmm1
movsd  0xd6f(%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     1385 <pix2ang_ring+0x225>
cvtsi2sdl -0x40(%rbp),%xmm0
movsd  0xd53(%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  0xcf8(%rip),%xmm0
subsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1040 <acos@plt>
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
cvtsi2sdl -0x38(%rbp),%xmm0
movsd  0xcbe(%rip),%xmm1
addsd  %xmm1,%xmm0
mulsd  -0x70(%rbp),%xmm0
cvtsi2sdl -0x34(%rbp),%xmm2
movsd  0xca0(%rip),%xmm1
mulsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    15b2 <pix2ang_ring+0x452>
movslq -0x40(%rbp),%rax
movslq -0x24(%rbp),%rcx
imul   $0x5,-0x8(%rbp),%rdx
add    $0x1,%rdx
imul   %rdx,%rcx
cmp    %rcx,%rax
jg     147b <pix2ang_ring+0x31b>
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  0xc33(%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  0xbaa(%rip),%xmm1
mulsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    15ad <pix2ang_ring+0x44d>
mov    -0x2c(%rbp),%eax
sub    -0x40(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
cvtsi2sdl -0x3c(%rbp),%xmm0
movsd  0xb7c(%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  0xb35(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xb31(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsi2sdl -0x3c(%rbp),%xmm2
cvtsi2sdl -0x34(%rbp),%xmm3
movsd  0xafb(%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  0xabb(%rip),%xmm0
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1040 <acos@plt>
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
cvtsi2sdl -0x38(%rbp),%xmm0
movsd  0xa91(%rip),%xmm1
addsd  %xmm1,%xmm0
mulsd  -0x70(%rbp),%xmm0
cvtsi2sdl -0x34(%rbp),%xmm2
movsd  0xa73(%rip),%xmm1
mulsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    15b2 <pix2ang_ring+0x452>
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    $0x28,%rsp
mov    %rdi,%rbx
lea    -0x2001(%rdi),%rax
cmp    $0xffffffffffffdfff,%rax
jbe    14be <pix2ang_ring+0x35e>
mov    %rsi,%r8
test   %rsi,%rsi
js     14a0 <pix2ang_ring+0x340>
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     14a0 <pix2ang_ring+0x340>
mov    %rdx,%r15
mov    0x2e30(%rip),%rcx
movsd  (%rcx),%xmm0
lea    0x1(%r8),%ebp
lea    (%rbx,%rbx,1),%r13
lea    -0x1(%rbx),%ecx
imul   %r13d,%ecx
cvtsi2sd %rbx,%xmm2
movsd  0xe30(%rip),%xmm1
mulsd  %xmm2,%xmm1
mulsd  %xmm2,%xmm1
cmp    %ecx,%ebp
movsd  %xmm0,0x20(%rsp)
jle    1247 <pix2ang_ring+0xe7>
movslq %ebp,%rdx
mov    %r13d,%esi
and    $0xfffffffe,%esi
lea    (%rbx,%rbx,4),%rdi
add    $0x1,%rdi
imul   %rsi,%rdi
cmp    %rdx,%rdi
jge    127e <pix2ang_ring+0x11e>
movsd  %xmm1,0x8(%rsp)
sub    %r8d,%eax
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
movsd  0xdf4(%rip),%xmm0
movsd  %xmm1,0x10(%rsp)
mulsd  %xmm1,%xmm0
movsd  %xmm0,(%rsp)
call   1080 <floor@plt>
xorpd  %xmm2,%xmm2
ucomisd %xmm2,%xmm0
jb     13ce <pix2ang_ring+0x26e>
sqrtsd %xmm0,%xmm0
jmp    13d7 <pix2ang_ring+0x277>
movsd  %xmm1,0x8(%rsp)
xorps  %xmm0,%xmm0
cvtsi2sd %ebp,%xmm0
mulsd  0xdb4(%rip),%xmm0
movsd  %xmm0,0x10(%rsp)
call   1080 <floor@plt>
xorpd  %xmm2,%xmm2
ucomisd %xmm2,%xmm0
jb     1336 <pix2ang_ring+0x1d6>
sqrtsd %xmm0,%xmm0
jmp    133f <pix2ang_ring+0x1df>
lea    0x0(,%rbx,4),%edi
movsd  0xd73(%rip),%xmm0
mulsd  %xmm2,%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  %xmm2,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
movsd  %xmm0,(%rsp)
sub    %ebp,%r13d
xorps  %xmm0,%xmm0
cvtsi2sd %r13d,%xmm0
divsd  0x10(%rsp),%xmm0
cvttsd2si %xmm0,%edi
call   1040 <acos@plt>
movsd  %xmm0,(%r15)
xorps  %xmm0,%xmm0
cvtsi2sd %r12d,%xmm0
movsd  (%rsp),%xmm1
mulsd  0xd07(%rip),%xmm1
addsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
movsd  0x20(%rsp),%xmm1
mulsd  %xmm0,%xmm1
movsd  0x8(%rsp),%xmm0
jmp    13c1 <pix2ang_ring+0x261>
call   1060 <sqrt@plt>
xorpd  %xmm2,%xmm2
movsd  0x10(%rsp),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
ucomisd %xmm2,%xmm1
jb     1359 <pix2ang_ring+0x1f9>
sqrtsd %xmm0,%xmm0
jmp    135e <pix2ang_ring+0x1fe>
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  0xc8d(%rip),%xmm1
subsd  %xmm0,%xmm1
cvttsd2si %xmm1,%edi
call   1040 <acos@plt>
xorps  %xmm1,%xmm1
cvtsi2sd %ebp,%xmm1
movsd  %xmm0,(%r15)
addsd  0xc74(%rip),%xmm1
movsd  0x20(%rsp),%xmm0
mulsd  %xmm1,%xmm0
movapd %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsi2sd %ebx,%xmm0
addsd  %xmm0,%xmm0
divsd  %xmm0,%xmm1
jmp    148c <pix2ang_ring+0x32c>
call   1060 <sqrt@plt>
xorpd  %xmm2,%xmm2
movsd  (%rsp),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
ucomisd %xmm2,%xmm1
jb     13f0 <pix2ang_ring+0x290>
sqrtsd %xmm0,%xmm0
jmp    13f5 <pix2ang_ring+0x295>
call   1060 <sqrt@plt>
call   1080 <floor@plt>
cvttsd2si %xmm0,%eax
add    $0x1,%eax
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
movsd  0xc18(%rip),%xmm2
mulsd  %xmm1,%xmm2
addsd  0xbfc(%rip),%xmm2
cvttpd2dq %xmm0,%xmm0
cvtdq2pd %xmm0,%xmm0
addsd  %xmm1,%xmm1
movsd  %xmm1,(%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  0xbd3(%rip),%xmm0
cvttsd2si %xmm0,%edi
call   1040 <acos@plt>
movsd  %xmm0,(%r15)
cvttpd2dq 0x10(%rsp),%xmm0
cvtdq2pd %xmm0,%xmm0
addsd  0xba3(%rip),%xmm0
movsd  0x20(%rsp),%xmm1
mulsd  %xmm0,%xmm1
divsd  (%rsp),%xmm1
movsd  %xmm1,(%r14)
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2b31(%rip),%rax
mov    (%rax),%edi
lea    0xc46(%rip),%rsi
lea    0xba3(%rip),%rdx
mov    $0x37,%ecx
jmp    14dd <pix2ang_ring+0x37d>
mov    0x2b13(%rip),%rax
mov    (%rax),%edi
lea    0xb6a(%rip),%rsi
lea    0xb85(%rip),%rdx
mov    $0x32,%ecx
mov    %rbx,%r8
call   1050 <fprintf@plt>
xor    %edi,%edi
call   1070 <exit@plt>

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

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