#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 */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ ang2pix_nest(long, double, double, long *);
int /*<<< orphan*/ ang2pix_ring(long, double, double, long *);
int /*<<< orphan*/ ang2vec(double, double, double *);
int /*<<< orphan*/ nest2ring(long, long, long *);
long nside2npix(long);
int /*<<< orphan*/ pix2ang_nest(long, long, double *, double *);
int /*<<< orphan*/ pix2ang_ring(long, long, double *, double *);
int /*<<< orphan*/ pix2vec_nest(long, long, double *);
int /*<<< orphan*/ pix2vec_ring(long, long, double *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ ring2nest(long, long, long *);
int /*<<< orphan*/ vec2ang(double *, double *, double *);
int /*<<< orphan*/ vec2pix_nest(long, double *, long *);
int /*<<< orphan*/ vec2pix_ring(long, double *, long *);
void test3(void) {
  double theta, phi;
  double vec[3];
  long nside;
  long ipix, npix, dpix, ip2, ip1;
  printf("Starting C Healpix pixel routines test\n");
  nside = 1024;
  dpix = 23;
  npix = nside2npix(nside);
  printf("Number of pixels in full map: %ld\n", npix);
  printf("dpix: %ld\n", dpix);
  printf("Nest -> ang -> vec -> ang -> Ring -> Nest\n");
  for (ipix = 0; ipix < npix; ipix += dpix) {
    pix2ang_nest(nside, ipix, &theta, &phi);
    ang2vec(theta, phi, vec);
    vec2ang(vec, &theta, &phi);
    ang2pix_ring(nside, theta, phi, &ip2);
    ring2nest(nside, ip2, &ip1);
    if (ip1 != ipix) {
      printf("Error: %ld %ld %ld %ld\n", nside, ipix, ip2, ip1);
      abort();
    }
  }
  printf("Ring -> ang -> Nest -> Ring\n");
  for (ipix = 0; ipix < npix; ipix += dpix) {
    pix2ang_ring(nside, ipix, &theta, &phi);
    ang2pix_nest(nside, theta, phi, &ip2);
    nest2ring(nside, ip2, &ip1);
    if (ip1 != ipix) {
      printf("Error: %ld %ld %ld %ld\n", nside, ipix, ip2, ip1);
    }
  }
  printf("Nest -> vec -> Ring -> Nest\n");
  for (ipix = 0; ipix < npix; ipix += dpix) {
    pix2vec_nest(nside, ipix, vec);
    vec2pix_ring(nside, vec, &ip2);
    ring2nest(nside, ip2, &ip1);
    if (ip1 != ipix) {
      printf("Error: %ld %ld %ld %ld\n", nside, ipix, ip2, ip1);
    }
  }
  printf("Ring -> vec -> Nest -> Ring\n");
  for (ipix = 0; ipix < npix; ipix += dpix) {
    pix2vec_ring(nside, ipix, vec);
    vec2pix_nest(nside, vec, &ip2);
    nest2ring(nside, ip2, &ip1);
    if (ip1 != ipix) {
      printf("Error: %ld %ld %ld %ld\n", nside, ipix, ip2, ip1);
    }
  }
  printf("%ld\n", nside);
  printf("test completed\n\n");
}


x86 assembly (clang, -O0):
<test3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
lea    0xe01(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
movq   $0x400,-0x38(%rbp)
movq   $0x17,-0x50(%rbp)
mov    -0x38(%rbp),%rdi
call   10b0 <nside2npix@plt>
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rsi
lea    0xdfa(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    -0x50(%rbp),%rsi
lea    0xe0b(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
lea    0xe08(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
movq   $0x0,-0x40(%rbp)
mov    -0x40(%rbp),%rax
cmp    -0x48(%rbp),%rax
jge    1315 <test3+0x125>
mov    -0x38(%rbp),%rdi
mov    -0x40(%rbp),%rsi
lea    -0x8(%rbp),%rdx
lea    -0x10(%rbp),%rcx
call   1070 <pix2ang_nest@plt>
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
lea    -0x30(%rbp),%rdi
call   10e0 <ang2vec@plt>
lea    -0x30(%rbp),%rdi
lea    -0x8(%rbp),%rsi
lea    -0x10(%rbp),%rdx
call   1050 <vec2ang@plt>
mov    -0x38(%rbp),%rdi
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
lea    -0x58(%rbp),%rsi
call   10c0 <ang2pix_ring@plt>
mov    -0x38(%rbp),%rdi
mov    -0x58(%rbp),%rsi
lea    -0x60(%rbp),%rdx
call   1090 <ring2nest@plt>
mov    -0x60(%rbp),%rax
cmp    -0x40(%rbp),%rax
je     12ff <test3+0x10f>
mov    -0x38(%rbp),%rsi
mov    -0x40(%rbp),%rdx
mov    -0x58(%rbp),%rcx
mov    -0x60(%rbp),%r8
lea    0xd90(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    $0x0,%al
call   1030 <abort@plt>
jmp    1304 <test3+0x114>
mov    -0x50(%rbp),%rax
add    -0x40(%rbp),%rax
mov    %rax,-0x40(%rbp)
jmp    125d <test3+0x6d>
lea    0xd7d(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
movq   $0x0,-0x40(%rbp)
mov    -0x40(%rbp),%rax
cmp    -0x48(%rbp),%rax
jge    13b8 <test3+0x1c8>
mov    -0x38(%rbp),%rdi
mov    -0x40(%rbp),%rsi
lea    -0x8(%rbp),%rdx
lea    -0x10(%rbp),%rcx
call   1060 <pix2ang_ring@plt>
mov    -0x38(%rbp),%rdi
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
lea    -0x58(%rbp),%rsi
call   1110 <ang2pix_nest@plt>
mov    -0x38(%rbp),%rdi
mov    -0x58(%rbp),%rsi
lea    -0x60(%rbp),%rdx
call   10a0 <nest2ring@plt>
mov    -0x60(%rbp),%rax
cmp    -0x40(%rbp),%rax
je     13a2 <test3+0x1b2>
mov    -0x38(%rbp),%rsi
mov    -0x40(%rbp),%rdx
mov    -0x58(%rbp),%rcx
mov    -0x60(%rbp),%r8
lea    0xce6(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
jmp    13a7 <test3+0x1b7>
mov    -0x50(%rbp),%rax
add    -0x40(%rbp),%rax
mov    %rax,-0x40(%rbp)
jmp    132b <test3+0x13b>
lea    0xcf7(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
movq   $0x0,-0x40(%rbp)
mov    -0x40(%rbp),%rax
cmp    -0x48(%rbp),%rax
jge    1451 <test3+0x261>
mov    -0x38(%rbp),%rdi
mov    -0x40(%rbp),%rsi
lea    -0x30(%rbp),%rdx
call   10d0 <pix2vec_nest@plt>
mov    -0x38(%rbp),%rdi
lea    -0x30(%rbp),%rsi
lea    -0x58(%rbp),%rdx
call   1040 <vec2pix_ring@plt>
mov    -0x38(%rbp),%rdi
mov    -0x58(%rbp),%rsi
lea    -0x60(%rbp),%rdx
call   1090 <ring2nest@plt>
mov    -0x60(%rbp),%rax
cmp    -0x40(%rbp),%rax
je     143b <test3+0x24b>
mov    -0x38(%rbp),%rsi
mov    -0x40(%rbp),%rdx
mov    -0x58(%rbp),%rcx
mov    -0x60(%rbp),%r8
lea    0xc4d(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
jmp    1440 <test3+0x250>
mov    -0x50(%rbp),%rax
add    -0x40(%rbp),%rax
mov    %rax,-0x40(%rbp)
jmp    13ce <test3+0x1de>
lea    0xc7b(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
movq   $0x0,-0x40(%rbp)
mov    -0x40(%rbp),%rax
cmp    -0x48(%rbp),%rax
jge    14ea <test3+0x2fa>
mov    -0x38(%rbp),%rdi
mov    -0x40(%rbp),%rsi
lea    -0x30(%rbp),%rdx
call   10f0 <pix2vec_ring@plt>
mov    -0x38(%rbp),%rdi
lea    -0x30(%rbp),%rsi
lea    -0x58(%rbp),%rdx
call   1100 <vec2pix_nest@plt>
mov    -0x38(%rbp),%rdi
mov    -0x58(%rbp),%rsi
lea    -0x60(%rbp),%rdx
call   10a0 <nest2ring@plt>
mov    -0x60(%rbp),%rax
cmp    -0x40(%rbp),%rax
je     14d4 <test3+0x2e4>
mov    -0x38(%rbp),%rsi
mov    -0x40(%rbp),%rdx
mov    -0x58(%rbp),%rcx
mov    -0x60(%rbp),%r8
lea    0xbb4(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
jmp    14d9 <test3+0x2e9>
mov    -0x50(%rbp),%rax
add    -0x40(%rbp),%rax
mov    %rax,-0x40(%rbp)
jmp    1467 <test3+0x277>
mov    -0x38(%rbp),%rsi
lea    0xb51(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
lea    0xbed(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test3>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
lea    0xe31(%rip),%rdi
call   1050 <puts@plt>
mov    $0x400,%edi
call   10c0 <nside2npix@plt>
mov    %rax,%r14
lea    0xdd2(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1090 <printf@plt>
lea    0xde4(%rip),%rdi
mov    $0x17,%esi
xor    %eax,%eax
call   1090 <printf@plt>
lea    0xe1b(%rip),%rdi
call   1050 <puts@plt>
test   %r14,%r14
jle    1430 <test3+0x230>
xor    %ebx,%ebx
lea    0x18(%rsp),%r15
lea    0x10(%rsp),%r12
lea    0x20(%rsp),%r13
lea    0x8(%rsp),%rbp
cs nopw 0x0(%rax,%rax,1)
mov    $0x400,%edi
mov    %rbx,%rsi
mov    %r15,%rdx
mov    %r12,%rcx
call   1080 <pix2ang_nest@plt>
movsd  0x18(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
mov    %r13,%rdi
call   10f0 <ang2vec@plt>
mov    %r13,%rdi
mov    %r15,%rsi
mov    %r12,%rdx
call   1060 <vec2ang@plt>
movsd  0x18(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
mov    $0x400,%edi
mov    %rsp,%rsi
call   10d0 <ang2pix_ring@plt>
mov    (%rsp),%rsi
mov    $0x400,%edi
mov    %rbp,%rdx
call   10a0 <ring2nest@plt>
mov    0x8(%rsp),%r8
cmp    %r8,%rbx
jne    150c <test3+0x30c>
add    $0x17,%rbx
cmp    %r14,%rbx
jl     1280 <test3+0x80>
lea    0xd9a(%rip),%rdi
call   1050 <puts@plt>
test   %r14,%r14
jle    143c <test3+0x23c>
lea    0x18(%rsp),%r15
lea    0x10(%rsp),%r12
mov    %rsp,%rbx
lea    0x8(%rsp),%rbp
xor    %r13d,%r13d
jmp    1339 <test3+0x139>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x17,%r13
cmp    %r14,%r13
jge    139c <test3+0x19c>
mov    $0x400,%edi
mov    %r13,%rsi
mov    %r15,%rdx
mov    %r12,%rcx
call   1070 <pix2ang_ring@plt>
movsd  0x18(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
mov    $0x400,%edi
mov    %rbx,%rsi
call   1120 <ang2pix_nest@plt>
mov    (%rsp),%rsi
mov    $0x400,%edi
mov    %rbp,%rdx
call   10b0 <nest2ring@plt>
mov    0x8(%rsp),%r8
cmp    %r8,%r13
je     1330 <test3+0x130>
mov    (%rsp),%rcx
mov    $0x400,%esi
lea    0xc9e(%rip),%rdi
mov    %r13,%rdx
xor    %eax,%eax
call   1090 <printf@plt>
jmp    1330 <test3+0x130>
lea    0xd10(%rip),%rdi
call   1050 <puts@plt>
test   %r14,%r14
jle    1448 <test3+0x248>
lea    0x20(%rsp),%rbx
mov    %rsp,%r15
lea    0x8(%rsp),%r13
lea    0xc69(%rip),%r12
xor    %ebp,%ebp
jmp    13dd <test3+0x1dd>
nopl   0x0(%rax)
add    $0x17,%rbp
cmp    %r14,%rbp
jge    1482 <test3+0x282>
mov    $0x400,%edi
mov    %rbp,%rsi
mov    %rbx,%rdx
call   10e0 <pix2vec_nest@plt>
mov    $0x400,%edi
mov    %rbx,%rsi
mov    %r15,%rdx
call   1040 <vec2pix_ring@plt>
mov    (%rsp),%rsi
mov    $0x400,%edi
mov    %r13,%rdx
call   10a0 <ring2nest@plt>
mov    0x8(%rsp),%r8
cmp    %r8,%rbp
je     13d0 <test3+0x1d0>
mov    (%rsp),%rcx
mov    $0x400,%esi
mov    %r12,%rdi
mov    %rbp,%rdx
xor    %eax,%eax
call   1090 <printf@plt>
jmp    13d0 <test3+0x1d0>
lea    0xc60(%rip),%rdi
call   1050 <puts@plt>
lea    0xc70(%rip),%rdi
call   1050 <puts@plt>
lea    0xc80(%rip),%rdi
call   1050 <puts@plt>
lea    0xbc3(%rip),%rdi
mov    $0x400,%esi
xor    %eax,%eax
call   1090 <printf@plt>
lea    0xc7d(%rip),%rdi
call   1050 <puts@plt>
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xc46(%rip),%rdi
call   1050 <puts@plt>
test   %r14,%r14
jle    1454 <test3+0x254>
lea    0x20(%rsp),%rbx
mov    %rsp,%r15
lea    0x8(%rsp),%r13
lea    0xb87(%rip),%r12
xor    %ebp,%ebp
jmp    14b9 <test3+0x2b9>
nopl   0x0(%rax,%rax,1)
add    $0x17,%rbp
cmp    %r14,%rbp
jge    1454 <test3+0x254>
mov    $0x400,%edi
mov    %rbp,%rsi
mov    %rbx,%rdx
call   1100 <pix2vec_ring@plt>
mov    $0x400,%edi
mov    %rbx,%rsi
mov    %r15,%rdx
call   1110 <vec2pix_nest@plt>
mov    (%rsp),%rsi
mov    $0x400,%edi
mov    %r13,%rdx
call   10b0 <nest2ring@plt>
mov    0x8(%rsp),%r8
cmp    %r8,%rbp
je     14b0 <test3+0x2b0>
mov    (%rsp),%rcx
mov    $0x400,%esi
mov    %r12,%rdi
mov    %rbp,%rdx
xor    %eax,%eax
call   1090 <printf@plt>
jmp    14b0 <test3+0x2b0>
mov    (%rsp),%rcx
lea    0xb17(%rip),%rdi
mov    $0x400,%esi
mov    %rbx,%rdx
xor    %eax,%eax
call   1090 <printf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@.str = [40 x i8] c"Starting C Healpix pixel routines test\0A\00"
@.str.1 = [35 x i8] c"Number of pixels in full map: %ld\0A\00"
@.str.2 = [11 x i8] c"dpix: %ld\0A\00"
@.str.3 = [43 x i8] c"Nest -> ang -> vec -> ang -> Ring -> Nest\0A\00"
@.str.4 = [24 x i8] c"Error: %ld %ld %ld %ld\0A\00"
@.str.5 = [29 x i8] c"Ring -> ang -> Nest -> Ring\0A\00"
@.str.6 = [29 x i8] c"Nest -> vec -> Ring -> Nest\0A\00"
@.str.7 = [29 x i8] c"Ring -> vec -> Nest -> Ring\0A\00"
@.str.8 = [5 x i8] c"%ld\0A\00"
@.str.9 = [17 x i8] c"test completed\0A\0A\00"
define void @test3() {
%1 = alloca double
%2 = alloca double
%3 = alloca [3 x double]
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
store i64 1024, i64* %4
store i64 23, i64* %7
%11 = load i64, i64* %4
%12 = call i64 @nside2npix(i64 %11)
store i64 %12, i64* %6
%13 = load i64, i64* %6
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i64 %13)
%15 = load i64, i64* %7
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i64 %15)
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.3, i64 0, i64 0))
store i64 0, i64* %5
br label %18
18: ; preds = %50, %0
%19 = load i64, i64* %5
%20 = load i64, i64* %6
%21 = icmp slt i64 %19, %20
br i1 %21, label %22, label %54
22: ; preds = %18
%23 = load i64, i64* %4
%24 = load i64, i64* %5
%25 = call i32 @pix2ang_nest(i64 %23, i64 %24, double* %1, double* %2)
%26 = load double, double* %1
%27 = load double, double* %2
%28 = getelementptr inbounds [3 x double], [3 x double]* %3, i64 0, i64 0
%29 = call i32 @ang2vec(double %26, double %27, double* %28)
%30 = getelementptr inbounds [3 x double], [3 x double]* %3, i64 0, i64 0
%31 = call i32 @vec2ang(double* %30, double* %1, double* %2)
%32 = load i64, i64* %4
%33 = load double, double* %1
%34 = load double, double* %2
%35 = call i32 @ang2pix_ring(i64 %32, double %33, double %34, i64* %8)
%36 = load i64, i64* %4
%37 = load i64, i64* %8
%38 = call i32 @ring2nest(i64 %36, i64 %37, i64* %9)
%39 = load i64, i64* %9
%40 = load i64, i64* %5
%41 = icmp ne i64 %39, %40
br i1 %41, label %42, label %49
42: ; preds = %22
%43 = load i64, i64* %4
%44 = load i64, i64* %5
%45 = load i64, i64* %8
%46 = load i64, i64* %9
%47 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0), i64 %43, i64 %44, i64 %45, i64 %46)
%48 = call i32 (...) @abort()
unreachable
49: ; preds = %22
br label %50
50: ; preds = %49
%51 = load i64, i64* %7
%52 = load i64, i64* %5
%53 = add nsw i64 %52, %51
store i64 %53, i64* %5
br label %18
54: ; preds = %18
%55 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.5, i64 0, i64 0))
store i64 0, i64* %5
br label %56
56: ; preds = %81, %54
%57 = load i64, i64* %5
%58 = load i64, i64* %6
%59 = icmp slt i64 %57, %58
br i1 %59, label %60, label %85
60: ; preds = %56
%61 = load i64, i64* %4
%62 = load i64, i64* %5
%63 = call i32 @pix2ang_ring(i64 %61, i64 %62, double* %1, double* %2)
%64 = load i64, i64* %4
%65 = load double, double* %1
%66 = load double, double* %2
%67 = call i32 @ang2pix_nest(i64 %64, double %65, double %66, i64* %8)
%68 = load i64, i64* %4
%69 = load i64, i64* %8
%70 = call i32 @nest2ring(i64 %68, i64 %69, i64* %9)
%71 = load i64, i64* %9
%72 = load i64, i64* %5
%73 = icmp ne i64 %71, %72
br i1 %73, label %74, label %80
74: ; preds = %60
%75 = load i64, i64* %4
%76 = load i64, i64* %5
%77 = load i64, i64* %8
%78 = load i64, i64* %9
%79 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0), i64 %75, i64 %76, i64 %77, i64 %78)
br label %80
80: ; preds = %74, %60
br label %81
81: ; preds = %80
%82 = load i64, i64* %7
%83 = load i64, i64* %5
%84 = add nsw i64 %83, %82
store i64 %84, i64* %5
br label %56
85: ; preds = %56
%86 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.6, i64 0, i64 0))
store i64 0, i64* %5
br label %87
87: ; preds = %112, %85
%88 = load i64, i64* %5
%89 = load i64, i64* %6
%90 = icmp slt i64 %88, %89
br i1 %90, label %91, label %116
91: ; preds = %87
%92 = load i64, i64* %4
%93 = load i64, i64* %5
%94 = getelementptr inbounds [3 x double], [3 x double]* %3, i64 0, i64 0
%95 = call i32 @pix2vec_nest(i64 %92, i64 %93, double* %94)
%96 = load i64, i64* %4
%97 = getelementptr inbounds [3 x double], [3 x double]* %3, i64 0, i64 0
%98 = call i32 @vec2pix_ring(i64 %96, double* %97, i64* %8)
%99 = load i64, i64* %4
%100 = load i64, i64* %8
%101 = call i32 @ring2nest(i64 %99, i64 %100, i64* %9)
%102 = load i64, i64* %9
%103 = load i64, i64* %5
%104 = icmp ne i64 %102, %103
br i1 %104, label %105, label %111
105: ; preds = %91
%106 = load i64, i64* %4
%107 = load i64, i64* %5
%108 = load i64, i64* %8
%109 = load i64, i64* %9
%110 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0), i64 %106, i64 %107, i64 %108, i64 %109)
br label %111
111: ; preds = %105, %91
br label %112
112: ; preds = %111
%113 = load i64, i64* %7
%114 = load i64, i64* %5
%115 = add nsw i64 %114, %113
store i64 %115, i64* %5
br label %87
116: ; preds = %87
%117 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.7, i64 0, i64 0))
store i64 0, i64* %5
br label %118
118: ; preds = %143, %116
%119 = load i64, i64* %5
%120 = load i64, i64* %6
%121 = icmp slt i64 %119, %120
br i1 %121, label %122, label %147
122: ; preds = %118
%123 = load i64, i64* %4
%124 = load i64, i64* %5
%125 = getelementptr inbounds [3 x double], [3 x double]* %3, i64 0, i64 0
%126 = call i32 @pix2vec_ring(i64 %123, i64 %124, double* %125)
%127 = load i64, i64* %4
%128 = getelementptr inbounds [3 x double], [3 x double]* %3, i64 0, i64 0
%129 = call i32 @vec2pix_nest(i64 %127, double* %128, i64* %8)
%130 = load i64, i64* %4
%131 = load i64, i64* %8
%132 = call i32 @nest2ring(i64 %130, i64 %131, i64* %9)
%133 = load i64, i64* %9
%134 = load i64, i64* %5
%135 = icmp ne i64 %133, %134
br i1 %135, label %136, label %142
136: ; preds = %122
%137 = load i64, i64* %4
%138 = load i64, i64* %5
%139 = load i64, i64* %8
%140 = load i64, i64* %9
%141 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0), i64 %137, i64 %138, i64 %139, i64 %140)
br label %142
142: ; preds = %136, %122
br label %143
143: ; preds = %142
%144 = load i64, i64* %7
%145 = load i64, i64* %5
%146 = add nsw i64 %145, %144
store i64 %146, i64* %5
br label %118
147: ; preds = %118
%148 = load i64, i64* %4
%149 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0), i64 %148)
%150 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.9, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.1 = [35 x i8] c"Number of pixels in full map: %ld\0A\00"
@.str.2 = [11 x i8] c"dpix: %ld\0A\00"
@.str.4 = [24 x i8] c"Error: %ld %ld %ld %ld\0A\00"
@.str.8 = [5 x i8] c"%ld\0A\00"
@str = [39 x i8] c"Starting C Healpix pixel routines test\00"
@str.10 = [42 x i8] c"Nest -> ang -> vec -> ang -> Ring -> Nest\00"
@str.11 = [28 x i8] c"Ring -> ang -> Nest -> Ring\00"
@str.12 = [28 x i8] c"Nest -> vec -> Ring -> Nest\00"
@str.13 = [28 x i8] c"Ring -> vec -> Nest -> Ring\00"
@str.14 = [16 x i8] c"test completed\0A\00"
define void @test3() {
%1 = alloca double
%2 = alloca double
%3 = alloca [3 x double]
%4 = alloca i64
%5 = alloca i64
%6 = bitcast double* %1 to i8*
%7 = bitcast double* %2 to i8*
%8 = bitcast [3 x double]* %3 to i8*
%9 = bitcast i64* %4 to i8*
%10 = bitcast i64* %5 to i8*
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str, i64 0, i64 0))
%12 = tail call i64 @nside2npix(i64 1024)
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i64 %12)
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i64 23)
%15 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str.10, i64 0, i64 0))
%16 = icmp sgt i64 %12, 0
br i1 %16, label %19, label %17
17: ; preds = %0
%18 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.11, i64 0, i64 0))
br label %60
19: ; preds = %0
%20 = getelementptr inbounds [3 x double], [3 x double]* %3, i64 0, i64 0
br label %21
21: ; preds = %19, %39
%22 = phi i64 [ 0, %19 ], [ %40, %39 ]
%23 = call i32 @pix2ang_nest(i64 1024, i64 %22, double* %1, double* %2)
%24 = load double, double* %1
%25 = load double, double* %2
%26 = call i32 @ang2vec(double %24, double %25, double* %20)
%27 = call i32 @vec2ang(double* %20, double* %1, double* %2)
%28 = load double, double* %1
%29 = load double, double* %2
%30 = call i32 @ang2pix_ring(i64 1024, double %28, double %29, i64* %4)
%31 = load i64, i64* %4
%32 = call i32 @ring2nest(i64 1024, i64 %31, i64* %5)
%33 = load i64, i64* %5
%34 = icmp eq i64 %33, %22
br i1 %34, label %39, label %35
35: ; preds = %21
%36 = load i64, i64* %4
%37 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0), i64 1024, i64 %22, i64 %36, i64 %33)
%38 = call i32 (...) @abort()
unreachable
39: ; preds = %21
%40 = add nuw nsw i64 %22, 23
%41 = icmp slt i64 %40, %12
br i1 %41, label %21, label %42
42: ; preds = %39
%43 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.11, i64 0, i64 0))
br i1 %16, label %44, label %60
44: ; preds = %42, %57
%45 = phi i64 [ %58, %57 ], [ 0, %42 ]
%46 = call i32 @pix2ang_ring(i64 1024, i64 %45, double* %1, double* %2)
%47 = load double, double* %1
%48 = load double, double* %2
%49 = call i32 @ang2pix_nest(i64 1024, double %47, double %48, i64* %4)
%50 = load i64, i64* %4
%51 = call i32 @nest2ring(i64 1024, i64 %50, i64* %5)
%52 = load i64, i64* %5
%53 = icmp eq i64 %52, %45
br i1 %53, label %57, label %54
54: ; preds = %44
%55 = load i64, i64* %4
%56 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0), i64 1024, i64 %45, i64 %55, i64 %52)
br label %57
57: ; preds = %44, %54
%58 = add nuw nsw i64 %45, 23
%59 = icmp slt i64 %58, %12
br i1 %59, label %44, label %62
60: ; preds = %17, %42
%61 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.12, i64 0, i64 0))
br label %80
62: ; preds = %57
%63 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.12, i64 0, i64 0))
br i1 %16, label %64, label %80
64: ; preds = %62
%65 = getelementptr inbounds [3 x double], [3 x double]* %3, i64 0, i64 0
br label %66
66: ; preds = %64, %77
%67 = phi i64 [ 0, %64 ], [ %78, %77 ]
%68 = call i32 @pix2vec_nest(i64 1024, i64 %67, double* %65)
%69 = call i32 @vec2pix_ring(i64 1024, double* %65, i64* %4)
%70 = load i64, i64* %4
%71 = call i32 @ring2nest(i64 1024, i64 %70, i64* %5)
%72 = load i64, i64* %5
%73 = icmp eq i64 %72, %67
br i1 %73, label %77, label %74
74: ; preds = %66
%75 = load i64, i64* %4
%76 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0), i64 1024, i64 %67, i64 %75, i64 %72)
br label %77
77: ; preds = %66, %74
%78 = add nuw nsw i64 %67, 23
%79 = icmp slt i64 %78, %12
br i1 %79, label %66, label %82
80: ; preds = %60, %62
%81 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.13, i64 0, i64 0))
br label %100
82: ; preds = %77
%83 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.13, i64 0, i64 0))
br i1 %16, label %84, label %100
84: ; preds = %82
%85 = getelementptr inbounds [3 x double], [3 x double]* %3, i64 0, i64 0
br label %86
86: ; preds = %84, %97
%87 = phi i64 [ 0, %84 ], [ %98, %97 ]
%88 = call i32 @pix2vec_ring(i64 1024, i64 %87, double* %85)
%89 = call i32 @vec2pix_nest(i64 1024, double* %85, i64* %4)
%90 = load i64, i64* %4
%91 = call i32 @nest2ring(i64 1024, i64 %90, i64* %5)
%92 = load i64, i64* %5
%93 = icmp eq i64 %92, %87
br i1 %93, label %97, label %94
94: ; preds = %86
%95 = load i64, i64* %4
%96 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0), i64 1024, i64 %87, i64 %95, i64 %92)
br label %97
97: ; preds = %86, %94
%98 = add nuw nsw i64 %87, 23
%99 = icmp slt i64 %98, %12
br i1 %99, label %86, label %100
100: ; preds = %97, %80, %82
%101 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0), i64 1024)
%102 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.14, i64 0, i64 0))
ret void
}