#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 atan2(double, double);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
double fabs(double);
scalar_t__ floor(int);
scalar_t__ fmod(int, int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, int, long const);
int /*<<< orphan*/ mk_xy2pix(int *, int *);
int pow(long const, int);
double sqrt(int);
int /*<<< orphan*/ stderr;
void vec2pix_nest(const long nside, double *vec, long *ipix) {
  double z, za, z0, tt, tp, tmp, phi;
  int face_num, jp, jm;
  long ifp, ifm;
  int ix, iy, ix_low, ix_hi, iy_low, iy_hi, ipf, ntt;
  double piover2 = 0.5 * M_PI, pi = M_PI, twopi = 2.0 * M_PI;
  int ns_max = 8192;
  static int x2pix[128], y2pix[128];
  static char setup_done = 0;
  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/vec2pix_nest.c",
            62, nside);
    exit(0);
  }
  if (!setup_done) {
    mk_xy2pix(x2pix, y2pix);
    setup_done = 1;
  }
  z = vec[2] / sqrt(vec[0] * vec[0] + vec[1] * vec[1] + vec[2] * vec[2]);
  phi = 0.0;
  if (vec[0] != 0.0 || vec[1] != 0.0) {
    phi = atan2(vec[1], vec[0]);
    if (phi < 0.0)
      phi += twopi;
  }
  za = fabs(z);
  z0 = 2. / 3.;
  tt = phi / piover2;
  if (za <= z0) {
    jp = (int)floor(ns_max * (0.5 + tt - z * 0.75));
    jm = (int)floor(ns_max * (0.5 + tt + z * 0.75));
    ifp = jp / ns_max;
    ifm = jm / ns_max;
    if (ifp == ifm)
      face_num = (int)fmod(ifp, 4) + 4;
    else if (ifp < ifm)
      face_num = (int)fmod(ifp, 4);
    else
      face_num = (int)fmod(ifm, 4) + 8;
    ix = (int)fmod(jm, ns_max);
    iy = ns_max - (int)fmod(jp, ns_max) - 1;
  } else {
    ntt = (int)floor(tt);
    if (ntt >= 4)
      ntt = 3;
    tp = tt - ntt;
    tmp = sqrt(3. * (1. - za));
    jp = (int)floor(ns_max * tp * tmp);
    jm = (int)floor(ns_max * (1. - tp) * tmp);
    jp = (int)(jp < ns_max - 1 ? jp : ns_max - 1);
    jm = (int)(jm < ns_max - 1 ? jm : ns_max - 1);
    if (z >= 0) {
      face_num = ntt;
      ix = ns_max - jm - 1;
      iy = ns_max - jp - 1;
    } else {
      face_num = ntt + 8;
      ix = jp;
      iy = jm;
    }
  }
  ix_low = (int)fmod(ix, 128);
  ix_hi = ix / 128;
  iy_low = (int)fmod(iy, 128);
  iy_hi = iy / 128;
  ipf = (x2pix[ix_hi] + y2pix[iy_hi]) * (128 * 128) +
        (x2pix[ix_low] + y2pix[iy_low]);
  ipf = (long)(ipf / pow(ns_max / nside, 2));
  *ipix = (long)(ipf + face_num * pow(nside, 2));
}


x86 assembly (clang, -O0):
<vec2pix_nest>:
push   %rbp
mov    %rsp,%rbp
sub    $0xd0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movsd  0xe69(%rip),%xmm0
mov    0x2e42(%rip),%rax
mulsd  (%rax),%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
mov    0x2e2f(%rip),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  0xe33(%rip),%xmm0
mov    0x2e14(%rip),%rax
mulsd  (%rax),%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
movl   $0x2000,-0xac(%rbp)
cmpq   $0x1,-0x8(%rbp)
jl     1209 <vec2pix_nest+0x89>
mov    -0x8(%rbp),%rax
movslq -0xac(%rbp),%rcx
cmp    %rcx,%rax
jle    1235 <vec2pix_nest+0xb5>
mov    0x2dc8(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%r8
lea    0xe23(%rip),%rsi
lea    0xe3e(%rip),%rdx
mov    $0x3e,%ecx
call   1060 <fprintf@plt>
xor    %edi,%edi
call   1090 <exit@plt>
cmpb   $0x0,0x3244(%rip)
jne    125c <vec2pix_nest+0xdc>
lea    0x2e37(%rip),%rdi
lea    0x3030(%rip),%rsi
call   1050 <mk_xy2pix@plt>
movb   $0x1,0x3224(%rip)
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm2
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
mulsd  0x8(%rax),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1080 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0xb8(%rbp),%xmm0
ff
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1312 <vec2pix_nest+0x192>
jp     1312 <vec2pix_nest+0x192>
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1312 <vec2pix_nest+0x192>
jp     1312 <vec2pix_nest+0x192>
jmp    1352 <vec2pix_nest+0x1d2>
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm1
call   1030 <atan2@plt>
movsd  %xmm0,-0x50(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x50(%rbp),%xmm0
jbe    134d <vec2pix_nest+0x1cd>
movsd  -0xa8(%rbp),%xmm0
ff
addsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
jmp    1352 <vec2pix_nest+0x1d2>
movsd  -0x20(%rbp),%xmm0
movaps 0xcd2(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xca1(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x50(%rbp),%xmm0
divsd  -0x98(%rbp),%xmm0
ff
movsd  %xmm0,-0x38(%rbp)
movsd  -0x28(%rbp),%xmm1
movsd  -0x30(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     14f0 <vec2pix_nest+0x370>
cvtsi2sdl -0xac(%rbp),%xmm0
ff
movsd  0xc5e(%rip),%xmm2
addsd  -0x38(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
movsd  0xc55(%rip),%xmm3
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   10a0 <floor@plt>
mov    %eax,-0x58(%rbp)
cvtsi2sdl -0xac(%rbp),%xmm0
ff
movsd  0xc0d(%rip),%xmm2
addsd  -0x38(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm1
movsd  0xc1b(%rip),%xmm3
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   10a0 <floor@plt>
mov    %eax,-0x5c(%rbp)
mov    -0x58(%rbp),%eax
cltd
idivl  -0xac(%rbp)
cltq
mov    %rax,-0x68(%rbp)
mov    -0x5c(%rbp),%eax
cltd
idivl  -0xac(%rbp)
cltq
mov    %rax,-0x70(%rbp)
mov    -0x68(%rbp),%rax
cmp    -0x70(%rbp),%rax
jne    146e <vec2pix_nest+0x2ee>
mov    -0x68(%rbp),%rax
mov    %eax,%edi
mov    $0x4,%esi
call   1040 <fmod@plt>
add    $0x4,%eax
mov    %eax,-0x54(%rbp)
jmp    14af <vec2pix_nest+0x32f>
mov    -0x68(%rbp),%rax
cmp    -0x70(%rbp),%rax
jge    1494 <vec2pix_nest+0x314>
mov    -0x68(%rbp),%rax
mov    %eax,%edi
mov    $0x4,%esi
call   1040 <fmod@plt>
mov    %eax,-0x54(%rbp)
jmp    14aa <vec2pix_nest+0x32a>
mov    -0x70(%rbp),%rax
mov    %eax,%edi
mov    $0x4,%esi
call   1040 <fmod@plt>
add    $0x8,%eax
mov    %eax,-0x54(%rbp)
jmp    14af <vec2pix_nest+0x32f>
mov    -0x5c(%rbp),%edi
mov    -0xac(%rbp),%esi
call   1040 <fmod@plt>
mov    %eax,-0x74(%rbp)
mov    -0xac(%rbp),%eax
mov    %eax,-0xbc(%rbp)
mov    -0x58(%rbp),%edi
mov    -0xac(%rbp),%esi
call   1040 <fmod@plt>
mov    %rax,%rcx
mov    -0xbc(%rbp),%eax
sub    %ecx,%eax
sub    $0x1,%eax
mov    %eax,-0x78(%rbp)
jmp    166b <vec2pix_nest+0x4eb>
cvttsd2si -0x38(%rbp),%edi
call   10a0 <floor@plt>
mov    %eax,-0x90(%rbp)
cmpl   $0x4,-0x90(%rbp)
jl     1517 <vec2pix_nest+0x397>
movl   $0x3,-0x90(%rbp)
movsd  -0x38(%rbp),%xmm0
cvtsi2sdl -0x90(%rbp),%xmm1
ff
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  0xae3(%rip),%xmm1
subsd  -0x28(%rbp),%xmm1
movsd  0xade(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1080 <sqrt@plt>
movsd  %xmm0,-0x48(%rbp)
cvtsi2sdl -0xac(%rbp),%xmm0
ff
mulsd  -0x40(%rbp),%xmm0
mulsd  -0x48(%rbp),%xmm0
cvttsd2si %xmm0,%edi
call   10a0 <floor@plt>
mov    %eax,-0x58(%rbp)
cvtsi2sdl -0xac(%rbp),%xmm0
ff
movsd  0xa96(%rip),%xmm1
subsd  -0x40(%rbp),%xmm1
mulsd  %xmm1,%xmm0
mulsd  -0x48(%rbp),%xmm0
cvttsd2si %xmm0,%edi
call   10a0 <floor@plt>
mov    %eax,-0x5c(%rbp)
mov    -0x58(%rbp),%eax
mov    -0xac(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    15be <vec2pix_nest+0x43e>
mov    -0x58(%rbp),%eax
mov    %eax,-0xc0(%rbp)
jmp    15cd <vec2pix_nest+0x44d>
mov    -0xac(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0xc0(%rbp)
mov    -0xc0(%rbp),%eax
mov    %eax,-0x58(%rbp)
mov    -0x5c(%rbp),%eax
mov    -0xac(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    15f8 <vec2pix_nest+0x478>
mov    -0x5c(%rbp),%eax
mov    %eax,-0xc4(%rbp)
jmp    1607 <vec2pix_nest+0x487>
mov    -0xac(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0xc4(%rbp)
mov    -0xc4(%rbp),%eax
mov    %eax,-0x5c(%rbp)
movsd  -0x20(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     164e <vec2pix_nest+0x4ce>
mov    -0x90(%rbp),%eax
mov    %eax,-0x54(%rbp)
mov    -0xac(%rbp),%eax
sub    -0x5c(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x74(%rbp)
mov    -0xac(%rbp),%eax
sub    -0x58(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x78(%rbp)
jmp    1666 <vec2pix_nest+0x4e6>
mov    -0x90(%rbp),%eax
add    $0x8,%eax
mov    %eax,-0x54(%rbp)
mov    -0x58(%rbp),%eax
mov    %eax,-0x74(%rbp)
mov    -0x5c(%rbp),%eax
mov    %eax,-0x78(%rbp)
jmp    166b <vec2pix_nest+0x4eb>
mov    -0x74(%rbp),%edi
mov    $0x80,%esi
call   1040 <fmod@plt>
mov    %eax,-0x7c(%rbp)
mov    -0x74(%rbp),%eax
mov    $0x80,%ecx
cltd
idiv   %ecx
mov    %eax,-0x80(%rbp)
mov    -0x78(%rbp),%edi
mov    $0x80,%esi
call   1040 <fmod@plt>
mov    %eax,-0x84(%rbp)
mov    -0x78(%rbp),%eax
mov    $0x80,%ecx
cltd
idiv   %ecx
mov    %eax,-0x88(%rbp)
movslq -0x80(%rbp),%rcx
lea    0x29c8(%rip),%rax
mov    (%rax,%rcx,4),%eax
movslq -0x88(%rbp),%rdx
lea    0x2bb7(%rip),%rcx
add    (%rcx,%rdx,4),%eax
shl    $0xe,%eax
movslq -0x7c(%rbp),%rdx
lea    0x29a6(%rip),%rcx
mov    (%rcx,%rdx,4),%ecx
movslq -0x84(%rbp),%rsi
lea    0x2b95(%rip),%rdx
add    (%rdx,%rsi,4),%ecx
add    %ecx,%eax
mov    %eax,-0x8c(%rbp)
mov    -0x8c(%rbp),%eax
mov    %eax,-0xd0(%rbp)
movslq -0xac(%rbp),%rax
cqto
idivq  -0x8(%rbp)
mov    %rax,%rdi
mov    $0x2,%esi
call   1070 <pow@plt>
mov    %eax,%ecx
mov    -0xd0(%rbp),%eax
cltd
idiv   %ecx
cltq
mov    %eax,-0x8c(%rbp)
mov    -0x8c(%rbp),%eax
mov    %eax,-0xc8(%rbp)
mov    -0x54(%rbp),%eax
mov    %eax,-0xcc(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2,%esi
call   1070 <pow@plt>
mov    -0xcc(%rbp),%ecx
mov    %eax,%edx
mov    -0xc8(%rbp),%eax
imul   %edx,%ecx
add    %ecx,%eax
movslq %eax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
add    $0xd0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vec2pix_nest>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    %rdi,%r15
lea    -0x2001(%rdi),%rax
cmp    $0xffffffffffffdfff,%rax
jbe    150e <vec2pix_nest+0x38e>
mov    %rdx,%rbp
mov    %rsi,%rbx
mov    0x2e37(%rip),%rax
movsd  (%rax),%xmm0
cmpb   $0x0,0x32c4(%rip)
movsd  %xmm0,0x10(%rsp)
jne    11e4 <vec2pix_nest+0x64>
lea    0x2eb5(%rip),%rdi
lea    0x30ae(%rip),%rsi
call   1050 <mk_xy2pix@plt>
movsd  0x10(%rsp),%xmm0
movb   $0x1,0x329c(%rip)
movsd  0xe14(%rip),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rsp)
movsd  0x10(%rbx),%xmm2
movapd %xmm2,0x20(%rsp)
movsd  (%rbx),%xmm0
movsd  0x8(%rbx),%xmm1
mulsd  %xmm1,%xmm1
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
movapd %xmm2,%xmm1
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
cvttsd2si %xmm1,%edi
call   1080 <sqrt@plt>
movapd 0x20(%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,0x20(%rsp)
movsd  (%rbx),%xmm1
movsd  0x8(%rbx),%xmm0
xorpd  %xmm3,%xmm3
ucomisd %xmm3,%xmm1
jne    125c <vec2pix_nest+0xdc>
jp     125c <vec2pix_nest+0xdc>
xorpd  %xmm2,%xmm2
ucomisd %xmm2,%xmm0
jne    125c <vec2pix_nest+0xdc>
jnp    127d <vec2pix_nest+0xfd>
call   1030 <atan2@plt>
movapd %xmm0,%xmm3
xorpd  %xmm0,%xmm0
ucomisd %xmm3,%xmm0
jbe    127d <vec2pix_nest+0xfd>
movsd  0x10(%rsp),%xmm0
addsd  %xmm0,%xmm0
addsd  %xmm0,%xmm3
divsd  0x8(%rsp),%xmm3
movapd 0xda5(%rip),%xmm2
movapd 0x20(%rsp),%xmm1
andpd  %xmm1,%xmm2
movsd  0xd6b(%rip),%xmm0
ucomisd %xmm2,%xmm0
mov    %rbp,0x30(%rsp)
jae    1385 <vec2pix_nest+0x205>
cvttsd2si %xmm3,%edi
movsd  %xmm3,0x8(%rsp)
movapd %xmm2,0x10(%rsp)
call   10a0 <floor@plt>
cmp    $0x3,%eax
mov    $0x3,%r12d
cmovl  %eax,%r12d
xorps  %xmm0,%xmm0
cvtsi2sd %r12d,%xmm0
movsd  0x8(%rsp),%xmm1
subsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rsp)
movsd  0xd32(%rip),%xmm0
subsd  0x10(%rsp),%xmm0
mulsd  0xd2c(%rip),%xmm0
cvttsd2si %xmm0,%edi
call   1080 <sqrt@plt>
movsd  %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm1
mulsd  0xcff(%rip),%xmm1
mulsd  %xmm0,%xmm1
cvttsd2si %xmm1,%edi
call   10a0 <floor@plt>
mov    %rax,%rbp
movsd  0xcef(%rip),%xmm0
subsd  0x8(%rsp),%xmm0
mulsd  0xcd9(%rip),%xmm0
mulsd  0x10(%rsp),%xmm0
cvttsd2si %xmm0,%edi
call   10a0 <floor@plt>
cmp    $0x1fff,%ebp
mov    $0x1fff,%ecx
cmovge %ecx,%ebp
mov    %rax,%rbx
cmp    $0x1fff,%ebx
cmovge %ecx,%ebx
xorpd  %xmm0,%xmm0
movapd 0x20(%rsp),%xmm1
ucomisd %xmm0,%xmm1
jae    140e <vec2pix_nest+0x28e>
add    $0x8,%r12d
jmp    1464 <vec2pix_nest+0x2e4>
addsd  0xc73(%rip),%xmm3
movsd  %xmm3,0x8(%rsp)
mulsd  0xc75(%rip),%xmm1
movapd %xmm1,0x20(%rsp)
subsd  %xmm1,%xmm3
mulsd  0xc6b(%rip),%xmm3
cvttsd2si %xmm3,%edi
call   10a0 <floor@plt>
mov    %rax,%r13
movapd 0x20(%rsp),%xmm0
addsd  0x8(%rsp),%xmm0
mulsd  0xc4b(%rip),%xmm0
cvttsd2si %xmm0,%edi
call   10a0 <floor@plt>
lea    0x1fff(%r13),%edi
test   %r13d,%r13d
cmovns %r13d,%edi
mov    %rax,%rbx
sar    $0xd,%edi
add    $0x1fff,%eax
test   %ebx,%ebx
cmovns %ebx,%eax
sar    $0xd,%eax
cmp    %eax,%edi
jne    141d <vec2pix_nest+0x29d>
mov    $0x4,%esi
call   1040 <fmod@plt>
mov    %rax,%r12
add    $0x4,%r12d
jmp    1441 <vec2pix_nest+0x2c1>
sub    %ebp,%ecx
mov    $0x1fff,%eax
sub    %ebx,%eax
mov    %ecx,%ebx
mov    %eax,%ebp
jmp    1464 <vec2pix_nest+0x2e4>
jge    142e <vec2pix_nest+0x2ae>
mov    $0x4,%esi
call   1040 <fmod@plt>
mov    %rax,%r12
jmp    1441 <vec2pix_nest+0x2c1>
mov    %eax,%edi
mov    $0x4,%esi
call   1040 <fmod@plt>
mov    %rax,%r12
add    $0x8,%r12d
mov    %ebx,%edi
mov    $0x2000,%esi
call   1040 <fmod@plt>
mov    %rax,%rbp
mov    %r13d,%edi
mov    $0x2000,%esi
call   1040 <fmod@plt>
mov    $0x1fff,%ebx
sub    %eax,%ebx
mov    %ebp,%edi
mov    $0x80,%esi
call   1040 <fmod@plt>
mov    %rax,%r13
lea    0x7f(%rbp),%r14d
test   %ebp,%ebp
cmovns %ebp,%r14d
sar    $0x7,%r14d
mov    %ebx,%edi
mov    $0x80,%esi
call   1040 <fmod@plt>
lea    0x7f(%rbx),%ecx
test   %ebx,%ebx
cmovns %ebx,%ecx
sar    $0x7,%ecx
movslq %r14d,%rdx
lea    0x2bde(%rip),%rsi
movslq %ecx,%rcx
lea    0x2dd4(%rip),%rdi
mov    (%rdi,%rcx,4),%ecx
add    (%rsi,%rdx,4),%ecx
shl    $0xe,%ecx
movslq %r13d,%rdx
cltq
mov    (%rdi,%rax,4),%ebx
add    (%rsi,%rdx,4),%ebx
add    %ecx,%ebx
mov    $0x2000,%ax
xor    %edx,%edx
div    %r15w
movzwl %ax,%edi
mov    $0x2,%esi
call   1070 <pow@plt>
mov    %eax,%ecx
mov    %ebx,%eax
cltd
idiv   %ecx
mov    %eax,%ebx
mov    %r15,%rdi
mov    $0x2,%esi
call   1070 <pow@plt>
imul   %r12d,%eax
add    %ebx,%eax
cltq
mov    0x30(%rsp),%rcx
mov    %rax,(%rcx)
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2ac3(%rip),%rax
mov    (%rax),%edi
lea    0xb22(%rip),%rsi
lea    0xb3d(%rip),%rdx
mov    $0x3e,%ecx
mov    %r15,%r8
call   1060 <fprintf@plt>
xor    %edi,%edi
call   1090 <exit@plt>

LLVM IR (-O0):
@M_PI = global double 0.000000e+00
@vec2pix_nest.x2pix = internal global [128 x i32] zeroinitializer
@vec2pix_nest.y2pix = internal global [128 x i32] zeroinitializer
@vec2pix_nest.setup_done = internal global i8 0
@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/vec2pix_nest.c\00"
define void @vec2pix_nest(i64 %0, double* %1, i64* %2) {
%4 = alloca i64
%5 = alloca double*
%6 = alloca i64*
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i64
%18 = alloca i64
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32
%22 = alloca i32
%23 = alloca i32
%24 = alloca i32
%25 = alloca i32
%26 = alloca i32
%27 = alloca double
%28 = alloca double
%29 = alloca double
%30 = alloca i32
store i64 %0, i64* %4
store double* %1, double** %5
store i64* %2, i64** %6
%31 = load double, double* @M_PI
%32 = fmul double 5.000000e-01, %31
store double %32, double* %27
%33 = load double, double* @M_PI
store double %33, double* %28
%34 = load double, double* @M_PI
%35 = fmul double 2.000000e+00, %34
store double %35, double* %29
store i32 8192, i32* %30
%36 = load i64, i64* %4
%37 = icmp slt i64 %36, 1
br i1 %37, label %43, label %38
38: ; preds = %3
%39 = load i64, i64* %4
%40 = load i32, i32* %30
%41 = sext i32 %40 to i64
%42 = icmp sgt i64 %39, %41
br i1 %42, label %43, label %48
43: ; preds = %38, %3
%44 = load i32, i32* @stderr
%45 = load i64, i64* %4
%46 = call i32 @fprintf(i32 %44, 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 62, i64 %45)
%47 = call i32 @exit(i32 0)
unreachable
48: ; preds = %38
%49 = load i8, i8* @vec2pix_nest.setup_done
%50 = icmp ne i8 %49, 0
br i1 %50, label %53, label %51
51: ; preds = %48
%52 = call i32 @mk_xy2pix(i32* getelementptr inbounds ([128 x i32], [128 x i32]* @vec2pix_nest.x2pix, i64 0, i64 0), i32* getelementptr inbounds ([128 x i32], [128 x i32]* @vec2pix_nest.y2pix, i64 0, i64 0))
store i8 1, i8* @vec2pix_nest.setup_done
br label %53
53: ; preds = %51, %48
%54 = load double*, double** %5
%55 = getelementptr inbounds double, double* %54, i64 2
%56 = load double, double* %55
%57 = load double*, double** %5
%58 = getelementptr inbounds double, double* %57, i64 0
%59 = load double, double* %58
%60 = load double*, double** %5
%61 = getelementptr inbounds double, double* %60, i64 0
%62 = load double, double* %61
%63 = load double*, double** %5
%64 = getelementptr inbounds double, double* %63, i64 1
%65 = load double, double* %64
%66 = load double*, double** %5
%67 = getelementptr inbounds double, double* %66, i64 1
%68 = load double, double* %67
%69 = fmul double %65, %68
%70 = call double @llvm.fmuladd.f64(double %59, double %62, double %69)
%71 = load double*, double** %5
%72 = getelementptr inbounds double, double* %71, i64 2
%73 = load double, double* %72
%74 = load double*, double** %5
%75 = getelementptr inbounds double, double* %74, i64 2
%76 = load double, double* %75
%77 = call double @llvm.fmuladd.f64(double %73, double %76, double %70)
%78 = fptosi double %77 to i32
%79 = call double @sqrt(i32 %78)
%80 = fdiv double %56, %79
store double %80, double* %7
store double 0.000000e+00, double* %13
%81 = load double*, double** %5
%82 = getelementptr inbounds double, double* %81, i64 0
%83 = load double, double* %82
%84 = fcmp une double %83, 0.000000e+00
br i1 %84, label %90, label %85
85: ; preds = %53
%86 = load double*, double** %5
%87 = getelementptr inbounds double, double* %86, i64 1
%88 = load double, double* %87
%89 = fcmp une double %88, 0.000000e+00
br i1 %89, label %90, label %105
90: ; preds = %85, %53
%91 = load double*, double** %5
%92 = getelementptr inbounds double, double* %91, i64 1
%93 = load double, double* %92
%94 = load double*, double** %5
%95 = getelementptr inbounds double, double* %94, i64 0
%96 = load double, double* %95
%97 = call double @atan2(double %93, double %96)
store double %97, double* %13
%98 = load double, double* %13
%99 = fcmp olt double %98, 0.000000e+00
br i1 %99, label %100, label %104
100: ; preds = %90
%101 = load double, double* %29
%102 = load double, double* %13
%103 = fadd double %102, %101
store double %103, double* %13
br label %104
104: ; preds = %100, %90
br label %105
105: ; preds = %104, %85
%106 = load double, double* %7
%107 = call double @llvm.fabs.f64(double %106)
store double %107, double* %8
store double 0x3FE5555555555555, double* %9
%108 = load double, double* %13
%109 = load double, double* %27
%110 = fdiv double %108, %109
store double %110, double* %10
%111 = load double, double* %8
%112 = load double, double* %9
%113 = fcmp ole double %111, %112
br i1 %113, label %114, label %181
114: ; preds = %105
%115 = load i32, i32* %30
%116 = sitofp i32 %115 to double
%117 = load double, double* %10
%118 = fadd double 5.000000e-01, %117
%119 = load double, double* %7
%120 = fneg double %119
%121 = call double @llvm.fmuladd.f64(double %120, double 7.500000e-01, double %118)
%122 = fmul double %116, %121
%123 = fptosi double %122 to i32
%124 = call i64 @floor(i32 %123)
%125 = trunc i64 %124 to i32
store i32 %125, i32* %15
%126 = load i32, i32* %30
%127 = sitofp i32 %126 to double
%128 = load double, double* %10
%129 = fadd double 5.000000e-01, %128
%130 = load double, double* %7
%131 = call double @llvm.fmuladd.f64(double %130, double 7.500000e-01, double %129)
%132 = fmul double %127, %131
%133 = fptosi double %132 to i32
%134 = call i64 @floor(i32 %133)
%135 = trunc i64 %134 to i32
store i32 %135, i32* %16
%136 = load i32, i32* %15
%137 = load i32, i32* %30
%138 = sdiv i32 %136, %137
%139 = sext i32 %138 to i64
store i64 %139, i64* %17
%140 = load i32, i32* %16
%141 = load i32, i32* %30
%142 = sdiv i32 %140, %141
%143 = sext i32 %142 to i64
store i64 %143, i64* %18
%144 = load i64, i64* %17
%145 = load i64, i64* %18
%146 = icmp eq i64 %144, %145
br i1 %146, label %147, label %153
147: ; preds = %114
%148 = load i64, i64* %17
%149 = trunc i64 %148 to i32
%150 = call i64 @fmod(i32 %149, i32 4)
%151 = trunc i64 %150 to i32
%152 = add nsw i32 %151, 4
store i32 %152, i32* %14
br label %169
153: ; preds = %114
%154 = load i64, i64* %17
%155 = load i64, i64* %18
%156 = icmp slt i64 %154, %155
br i1 %156, label %157, label %162
157: ; preds = %153
%158 = load i64, i64* %17
%159 = trunc i64 %158 to i32
%160 = call i64 @fmod(i32 %159, i32 4)
%161 = trunc i64 %160 to i32
store i32 %161, i32* %14
br label %168
162: ; preds = %153
%163 = load i64, i64* %18
%164 = trunc i64 %163 to i32
%165 = call i64 @fmod(i32 %164, i32 4)
%166 = trunc i64 %165 to i32
%167 = add nsw i32 %166, 8
store i32 %167, i32* %14
br label %168
168: ; preds = %162, %157
br label %169
169: ; preds = %168, %147
%170 = load i32, i32* %16
%171 = load i32, i32* %30
%172 = call i64 @fmod(i32 %170, i32 %171)
%173 = trunc i64 %172 to i32
store i32 %173, i32* %19
%174 = load i32, i32* %30
%175 = load i32, i32* %15
%176 = load i32, i32* %30
%177 = call i64 @fmod(i32 %175, i32 %176)
%178 = trunc i64 %177 to i32
%179 = sub nsw i32 %174, %178
%180 = sub nsw i32 %179, 1
store i32 %180, i32* %20
br label %258
181: ; preds = %105
%182 = load double, double* %10
%183 = fptosi double %182 to i32
%184 = call i64 @floor(i32 %183)
%185 = trunc i64 %184 to i32
store i32 %185, i32* %26
%186 = load i32, i32* %26
%187 = icmp sge i32 %186, 4
br i1 %187, label %188, label %189
188: ; preds = %181
store i32 3, i32* %26
br label %189
189: ; preds = %188, %181
%190 = load double, double* %10
%191 = load i32, i32* %26
%192 = sitofp i32 %191 to double
%193 = fsub double %190, %192
store double %193, double* %11
%194 = load double, double* %8
%195 = fsub double 1.000000e+00, %194
%196 = fmul double 3.000000e+00, %195
%197 = fptosi double %196 to i32
%198 = call double @sqrt(i32 %197)
store double %198, double* %12
%199 = load i32, i32* %30
%200 = sitofp i32 %199 to double
%201 = load double, double* %11
%202 = fmul double %200, %201
%203 = load double, double* %12
%204 = fmul double %202, %203
%205 = fptosi double %204 to i32
%206 = call i64 @floor(i32 %205)
%207 = trunc i64 %206 to i32
store i32 %207, i32* %15
%208 = load i32, i32* %30
%209 = sitofp i32 %208 to double
%210 = load double, double* %11
%211 = fsub double 1.000000e+00, %210
%212 = fmul double %209, %211
%213 = load double, double* %12
%214 = fmul double %212, %213
%215 = fptosi double %214 to i32
%216 = call i64 @floor(i32 %215)
%217 = trunc i64 %216 to i32
store i32 %217, i32* %16
%218 = load i32, i32* %15
%219 = load i32, i32* %30
%220 = sub nsw i32 %219, 1
%221 = icmp slt i32 %218, %220
br i1 %221, label %222, label %224
222: ; preds = %189
%223 = load i32, i32* %15
br label %227
224: ; preds = %189
%225 = load i32, i32* %30
%226 = sub nsw i32 %225, 1
br label %227
227: ; preds = %224, %222
%228 = phi i32 [ %223, %222 ], [ %226, %224 ]
store i32 %228, i32* %15
%229 = load i32, i32* %16
%230 = load i32, i32* %30
%231 = sub nsw i32 %230, 1
%232 = icmp slt i32 %229, %231
br i1 %232, label %233, label %235
233: ; preds = %227
%234 = load i32, i32* %16
br label %238
235: ; preds = %227
%236 = load i32, i32* %30
%237 = sub nsw i32 %236, 1
br label %238
238: ; preds = %235, %233
%239 = phi i32 [ %234, %233 ], [ %237, %235 ]
store i32 %239, i32* %16
%240 = load double, double* %7
%241 = fcmp oge double %240, 0.000000e+00
br i1 %241, label %242, label %252
242: ; preds = %238
%243 = load i32, i32* %26
store i32 %243, i32* %14
%244 = load i32, i32* %30
%245 = load i32, i32* %16
%246 = sub nsw i32 %244, %245
%247 = sub nsw i32 %246, 1
store i32 %247, i32* %19
%248 = load i32, i32* %30
%249 = load i32, i32* %15
%250 = sub nsw i32 %248, %249
%251 = sub nsw i32 %250, 1
store i32 %251, i32* %20
br label %257
252: ; preds = %238
%253 = load i32, i32* %26
%254 = add nsw i32 %253, 8
store i32 %254, i32* %14
%255 = load i32, i32* %15
store i32 %255, i32* %19
%256 = load i32, i32* %16
store i32 %256, i32* %20
br label %257
257: ; preds = %252, %242
br label %258
258: ; preds = %257, %169
%259 = load i32, i32* %19
%260 = call i64 @fmod(i32 %259, i32 128)
%261 = trunc i64 %260 to i32
store i32 %261, i32* %21
%262 = load i32, i32* %19
%263 = sdiv i32 %262, 128
store i32 %263, i32* %22
%264 = load i32, i32* %20
%265 = call i64 @fmod(i32 %264, i32 128)
%266 = trunc i64 %265 to i32
store i32 %266, i32* %23
%267 = load i32, i32* %20
%268 = sdiv i32 %267, 128
store i32 %268, i32* %24
%269 = load i32, i32* %22
%270 = sext i32 %269 to i64
%271 = getelementptr inbounds [128 x i32], [128 x i32]* @vec2pix_nest.x2pix, i64 0, i64 %270
%272 = load i32, i32* %271
%273 = load i32, i32* %24
%274 = sext i32 %273 to i64
%275 = getelementptr inbounds [128 x i32], [128 x i32]* @vec2pix_nest.y2pix, i64 0, i64 %274
%276 = load i32, i32* %275
%277 = add nsw i32 %272, %276
%278 = mul nsw i32 %277, 16384
%279 = load i32, i32* %21
%280 = sext i32 %279 to i64
%281 = getelementptr inbounds [128 x i32], [128 x i32]* @vec2pix_nest.x2pix, i64 0, i64 %280
%282 = load i32, i32* %281
%283 = load i32, i32* %23
%284 = sext i32 %283 to i64
%285 = getelementptr inbounds [128 x i32], [128 x i32]* @vec2pix_nest.y2pix, i64 0, i64 %284
%286 = load i32, i32* %285
%287 = add nsw i32 %282, %286
%288 = add nsw i32 %278, %287
store i32 %288, i32* %25
%289 = load i32, i32* %25
%290 = load i32, i32* %30
%291 = sext i32 %290 to i64
%292 = load i64, i64* %4
%293 = sdiv i64 %291, %292
%294 = call i32 @pow(i64 %293, i32 2)
%295 = sdiv i32 %289, %294
%296 = sext i32 %295 to i64
%297 = trunc i64 %296 to i32
store i32 %297, i32* %25
%298 = load i32, i32* %25
%299 = load i32, i32* %14
%300 = load i64, i64* %4
%301 = call i32 @pow(i64 %300, i32 2)
%302 = mul nsw i32 %299, %301
%303 = add nsw i32 %298, %302
%304 = sext i32 %303 to i64
%305 = load i64*, i64** %6
store i64 %304, i64* %305
ret void
}

LLVM IR (-O2):
@M_PI = global double 0.000000e+00
@vec2pix_nest.x2pix = internal global [128 x i32] zeroinitializer
@vec2pix_nest.y2pix = internal global [128 x i32] zeroinitializer
@vec2pix_nest.setup_done = internal unnamed_addr global i1 false
@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/vec2pix_nest.c\00"
define void @vec2pix_nest(i64 %0, double* nocapture %1, i64* nocapture writeonly %2) {
%4 = load double, double* @M_PI
%5 = fmul double %4, 5.000000e-01
%6 = fmul double %4, 2.000000e+00
%7 = add i64 %0, -8193
%8 = icmp ult i64 %7, -8192
br i1 %8, label %9, label %13
9: ; preds = %3
%10 = load i32, i32* @stderr
%11 = tail call i32 @fprintf(i32 %10, 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 62, i64 %0)
%12 = tail call i32 @exit(i32 0)
unreachable
13: ; preds = %3
%14 = load i1, i1* @vec2pix_nest.setup_done
br i1 %14, label %17, label %15
15: ; preds = %13
%16 = tail call i32 @mk_xy2pix(i32* getelementptr inbounds ([128 x i32], [128 x i32]* @vec2pix_nest.x2pix, i64 0, i64 0), i32* getelementptr inbounds ([128 x i32], [128 x i32]* @vec2pix_nest.y2pix, i64 0, i64 0))
store i1 true, i1* @vec2pix_nest.setup_done
br label %17
17: ; preds = %15, %13
%18 = getelementptr inbounds double, double* %1, i64 2
%19 = load double, double* %18
%20 = load double, double* %1
%21 = getelementptr inbounds double, double* %1, i64 1
%22 = load double, double* %21
%23 = fmul double %22, %22
%24 = tail call double @llvm.fmuladd.f64(double %20, double %20, double %23)
%25 = tail call double @llvm.fmuladd.f64(double %19, double %19, double %24)
%26 = fptosi double %25 to i32
%27 = tail call double @sqrt(i32 %26)
%28 = fdiv double %19, %27
%29 = load double, double* %1
%30 = fcmp une double %29, 0.000000e+00
%31 = load double, double* %21
%32 = fcmp une double %31, 0.000000e+00
%33 = select i1 %30, i1 true, i1 %32
br i1 %33, label %34, label %39
34: ; preds = %17
%35 = tail call double @atan2(double %31, double %29)
%36 = fcmp olt double %35, 0.000000e+00
br i1 %36, label %37, label %39
37: ; preds = %34
%38 = fadd double %6, %35
br label %39
39: ; preds = %17, %34, %37
%40 = phi double [ %38, %37 ], [ %35, %34 ], [ 0.000000e+00, %17 ]
%41 = tail call double @llvm.fabs.f64(double %28)
%42 = fdiv double %40, %5
%43 = fcmp ugt double %41, 0x3FE5555555555555
br i1 %43, label %80, label %44
44: ; preds = %39
%45 = fadd double %42, 5.000000e-01
%46 = fneg double %28
%47 = tail call double @llvm.fmuladd.f64(double %46, double 7.500000e-01, double %45)
%48 = fmul double %47, 8.192000e+03
%49 = fptosi double %48 to i32
%50 = tail call i64 @floor(i32 %49)
%51 = trunc i64 %50 to i32
%52 = tail call double @llvm.fmuladd.f64(double %28, double 7.500000e-01, double %45)
%53 = fmul double %52, 8.192000e+03
%54 = fptosi double %53 to i32
%55 = tail call i64 @floor(i32 %54)
%56 = trunc i64 %55 to i32
%57 = sdiv i32 %51, 8192
%58 = sdiv i32 %56, 8192
%59 = icmp eq i32 %57, %58
br i1 %59, label %60, label %64
60: ; preds = %44
%61 = tail call i64 @fmod(i32 %57, i32 4)
%62 = trunc i64 %61 to i32
%63 = add nsw i32 %62, 4
br label %73
64: ; preds = %44
%65 = icmp slt i32 %57, %58
br i1 %65, label %66, label %69
66: ; preds = %64
%67 = tail call i64 @fmod(i32 %57, i32 4)
%68 = trunc i64 %67 to i32
br label %73
69: ; preds = %64
%70 = tail call i64 @fmod(i32 %58, i32 4)
%71 = trunc i64 %70 to i32
%72 = add nsw i32 %71, 8
br label %73
73: ; preds = %66, %69, %60
%74 = phi i32 [ %63, %60 ], [ %68, %66 ], [ %72, %69 ]
%75 = tail call i64 @fmod(i32 %56, i32 8192)
%76 = trunc i64 %75 to i32
%77 = tail call i64 @fmod(i32 %51, i32 8192)
%78 = trunc i64 %77 to i32
%79 = sub i32 8191, %78
br label %113
80: ; preds = %39
%81 = fptosi double %42 to i32
%82 = tail call i64 @floor(i32 %81)
%83 = trunc i64 %82 to i32
%84 = icmp slt i32 %83, 3
%85 = select i1 %84, i32 %83, i32 3
%86 = sitofp i32 %85 to double
%87 = fsub double %42, %86
%88 = fsub double 1.000000e+00, %41
%89 = fmul double %88, 3.000000e+00
%90 = fptosi double %89 to i32
%91 = tail call double @sqrt(i32 %90)
%92 = fmul double %87, 8.192000e+03
%93 = fmul double %91, %92
%94 = fptosi double %93 to i32
%95 = tail call i64 @floor(i32 %94)
%96 = trunc i64 %95 to i32
%97 = fsub double 1.000000e+00, %87
%98 = fmul double %97, 8.192000e+03
%99 = fmul double %91, %98
%100 = fptosi double %99 to i32
%101 = tail call i64 @floor(i32 %100)
%102 = trunc i64 %101 to i32
%103 = icmp slt i32 %96, 8191
%104 = select i1 %103, i32 %96, i32 8191
%105 = icmp slt i32 %102, 8191
%106 = select i1 %105, i32 %102, i32 8191
%107 = fcmp ult double %28, 0.000000e+00
br i1 %107, label %111, label %108
108: ; preds = %80
%109 = sub i32 8191, %106
%110 = sub i32 8191, %104
br label %113
111: ; preds = %80
%112 = add nsw i32 %85, 8
br label %113
113: ; preds = %108, %111, %73
%114 = phi i32 [ %79, %73 ], [ %110, %108 ], [ %106, %111 ]
%115 = phi i32 [ %76, %73 ], [ %109, %108 ], [ %104, %111 ]
%116 = phi i32 [ %74, %73 ], [ %85, %108 ], [ %112, %111 ]
%117 = tail call i64 @fmod(i32 %115, i32 128)
%118 = sdiv i32 %115, 128
%119 = tail call i64 @fmod(i32 %114, i32 128)
%120 = sdiv i32 %114, 128
%121 = sext i32 %118 to i64
%122 = getelementptr inbounds [128 x i32], [128 x i32]* @vec2pix_nest.x2pix, i64 0, i64 %121
%123 = load i32, i32* %122
%124 = sext i32 %120 to i64
%125 = getelementptr inbounds [128 x i32], [128 x i32]* @vec2pix_nest.y2pix, i64 0, i64 %124
%126 = load i32, i32* %125
%127 = add nsw i32 %126, %123
%128 = shl nsw i32 %127, 14
%129 = shl i64 %117, 32
%130 = ashr exact i64 %129, 32
%131 = getelementptr inbounds [128 x i32], [128 x i32]* @vec2pix_nest.x2pix, i64 0, i64 %130
%132 = load i32, i32* %131
%133 = shl i64 %119, 32
%134 = ashr exact i64 %133, 32
%135 = getelementptr inbounds [128 x i32], [128 x i32]* @vec2pix_nest.y2pix, i64 0, i64 %134
%136 = load i32, i32* %135
%137 = add nsw i32 %136, %132
%138 = add nsw i32 %137, %128
%139 = trunc i64 %0 to i16
%140 = udiv i16 8192, %139
%141 = zext i16 %140 to i64
%142 = tail call i32 @pow(i64 %141, i32 2)
%143 = sdiv i32 %138, %142
%144 = tail call i32 @pow(i64 %0, i32 2)
%145 = mul nsw i32 %144, %116
%146 = add nsw i32 %145, %143
%147 = sext i32 %146 to i64
store i64 %147, i64* %2
ret void
}