main() {
  static int atomnum, n, i, j, k, l, m, i1, i2, j1, j2;
  static double za0, za1, za2, za3;
  static double ka1, ka2, ka3, al, be, ga, c1, c2, c3, s2, s3;
  static double **xyz, rxyz[10], tvxyz[5][4];
  static double tvx[5], tvy[5], tvz[5];
  static double atvx[15], atvy[15], atvz[15];
  static double la1, la2, la3, ang1, ang2, ang3;
  static double r, dx, dy, dz;
  static char Name[100];
  scanf("%lf %lf %lf", &la1, &la2, &la3);
  scanf("%lf %lf %lf", &ang1, &ang2, &ang3);
  scanf("%i", &atomnum);
  xyz = (double **)malloc(sizeof(double *) * (atomnum + 1));
  for (i = 0; i <= atomnum; i++) {
    xyz[i] = (double *)malloc(sizeof(double) * 4);
  }
  ang1 = 3.1415926535897932384626 * ang1 / 180.0;
  ang2 = 3.1415926535897932384626 * ang2 / 180.0;
  ang3 = 3.1415926535897932384626 * ang3 / 180.0;
  tvx[1] = la1 * cos(ang2);
  tvz[1] = (la1 * cos(ang3) - tvx[1] * cos(ang1)) / sin(ang1);
  tvy[1] = sqrt(la1 * la1 - tvx[1] * tvx[1] - tvz[1] * tvz[1]);
  tvx[2] = la2 * cos(ang1);
  tvy[2] = 0;
  tvz[2] = la2 * sin(ang1);
  tvx[3] = la3;
  tvy[3] = 0;
  tvz[3] = 0;
  ATV(atvx, atvy, atvz, tvx, tvy, tvz);
  for (i = 1; i <= atomnum; i++) {
    scanf("%lf  %s %lf %lf %lf", &za0, &Name, &za1, &za2, &za3);
    xyz[i][0] = za0;
    xyz[i][1] = za1 * tvx[1] + za2 * tvx[2] + za3 * tvx[3];
    xyz[i][2] = za1 * tvy[1] + za2 * tvy[2] + za3 * tvy[3];
    xyz[i][3] = za1 * tvz[1] + za2 * tvz[2] + za3 * tvz[3];
    printf("%4d   %3s %16.12f  %16.12f  %16.12f\n", i, Name, xyz[i][1],
           xyz[i][2], xyz[i][3]);
  }
  for (i = 0; i <= atomnum; i++) {
    free(xyz[i]);
  }
  free(xyz);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe85(%rip),%rdi
lea    0x327b(%rip),%rsi
lea    0x327c(%rip),%rdx
lea    0x327d(%rip),%rcx
mov    $0x0,%al
call   1070 <scanf@plt>
lea    0xe62(%rip),%rdi
lea    0x3270(%rip),%rsi
lea    0x3271(%rip),%rdx
lea    0x3272(%rip),%rcx
mov    $0x0,%al
call   1070 <scanf@plt>
lea    0xe34(%rip),%rdi
lea    0x2e8d(%rip),%rsi
mov    $0x0,%al
call   1070 <scanf@plt>
mov    0x2e80(%rip),%eax
add    $0x1,%eax
movslq %eax,%rdi
shl    $0x3,%rdi
call   1060 <malloc@plt>
mov    %rax,0x2f12(%rip)
movl   $0x0,0x2e68(%rip)
mov    0x2e62(%rip),%eax
cmp    0x2e54(%rip),%eax
jg     1255 <main+0xd5>
mov    $0x20,%edi
call   1060 <malloc@plt>
mov    %rax,%rdx
mov    0x2ee2(%rip),%rax
movslq 0x2e3b(%rip),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    0x2e31(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2e28(%rip)
jmp    1210 <main+0x90>
movsd  0xdab(%rip),%xmm0
mulsd  0x31cb(%rip),%xmm0
movsd  0xd93(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,0x31b7(%rip)
movsd  0xd87(%rip),%xmm0
mulsd  0x31af(%rip),%xmm0
movsd  0xd6f(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,0x319b(%rip)
movsd  0xd63(%rip),%xmm0
mulsd  0x3193(%rip),%xmm0
movsd  0xd4b(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,0x317f(%rip)
movsd  0x314f(%rip),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  0x3162(%rip),%xmm0
call   1080 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0x40(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,0x2f29(%rip)
movsd  0x3121(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0x313c(%rip),%xmm0
call   1080 <cos@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  0x2f02(%rip),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  0x310d(%rip),%xmm0
call   1080 <cos@plt>
movsd  -0x38(%rbp),%xmm1
movsd  -0x30(%rbp),%xmm2
movaps %xmm0,%xmm3
movsd  -0x28(%rbp),%xmm0
mulsd  %xmm3,%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0x30c6(%rip),%xmm0
call   1050 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,0x2ef5(%rip)
movsd  0x308d(%rip),%xmm1
movsd  0x3085(%rip),%xmm2
movsd  0x2e7d(%rip),%xmm0
mulsd  0x2e75(%rip),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  0x2eae(%rip),%xmm0
movsd  0x2ea6(%rip),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1090 <sqrt@plt>
movsd  %xmm0,0x2e4a(%rip)
movsd  0x301a(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0x301d(%rip),%xmm0
call   1080 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,0x2df4(%rip)
xorps  %xmm0,%xmm0
movsd  %xmm0,0x2e19(%rip)
movsd  0x2fe1(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0x2fe4(%rip),%xmm0
call   1050 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,0x2e1b(%rip)
movsd  0x2fbb(%rip),%xmm0
movsd  %xmm0,0x2db3(%rip)
xorps  %xmm0,%xmm0
movsd  %xmm0,0x2dd8(%rip)
xorps  %xmm0,%xmm0
movsd  %xmm0,0x2dfd(%rip)
lea    0x2e0e(%rip),%rdi
lea    0x2e87(%rip),%rsi
lea    0x2f00(%rip),%rdx
lea    0x2d69(%rip),%rcx
lea    0x2d92(%rip),%r8
lea    0x2dbb(%rip),%r9
mov    $0x0,%al
call   10a0 <ATV@plt>
movl   $0x1,0x2bb2(%rip)
mov    0x2bac(%rip),%eax
cmp    0x2b9e(%rip),%eax
jg     16a0 <main+0x520>
lea    0xb34(%rip),%rdi
lea    0x2bba(%rip),%rsi
lea    0x2f83(%rip),%rdx
lea    0x2bb4(%rip),%rcx
lea    0x2bb5(%rip),%r8
lea    0x2bb6(%rip),%r9
mov    $0x0,%al
call   1070 <scanf@plt>
movsd  0x2b8f(%rip),%xmm0
mov    0x2c00(%rip),%rax
movslq 0x2b59(%rip),%rcx
mov    (%rax,%rcx,8),%rax
movsd  %xmm0,(%rax)
movsd  0x2b79(%rip),%xmm1
movsd  0x2ce1(%rip),%xmm2
movsd  0x2b71(%rip),%xmm0
mulsd  0x2cd9(%rip),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  0x2b61(%rip),%xmm0
movsd  0x2cc9(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    0x2baa(%rip),%rax
movslq 0x2b03(%rip),%rcx
mov    (%rax,%rcx,8),%rax
movsd  %xmm0,0x8(%rax)
movsd  0x2b22(%rip),%xmm1
movsd  0x2cba(%rip),%xmm2
movsd  0x2b1a(%rip),%xmm0
mulsd  0x2cb2(%rip),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  0x2b0a(%rip),%xmm0
movsd  0x2ca2(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    0x2b53(%rip),%rax
movslq 0x2aac(%rip),%rcx
mov    (%rax,%rcx,8),%rax
movsd  %xmm0,0x10(%rax)
movsd  0x2acb(%rip),%xmm1
movsd  0x2c93(%rip),%xmm2
movsd  0x2ac3(%rip),%xmm0
mulsd  0x2c8b(%rip),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  0x2ab3(%rip),%xmm0
movsd  0x2c7b(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    0x2afc(%rip),%rax
movslq 0x2a55(%rip),%rcx
mov    (%rax,%rcx,8),%rax
movsd  %xmm0,0x18(%rax)
mov    0x2a46(%rip),%esi
mov    0x2adf(%rip),%rax
movslq 0x2a38(%rip),%rcx
mov    (%rax,%rcx,8),%rax
movsd  0x8(%rax),%xmm0
mov    0x2ac8(%rip),%rax
movslq 0x2a21(%rip),%rcx
mov    (%rax,%rcx,8),%rax
movsd  0x10(%rax),%xmm1
mov    0x2ab1(%rip),%rax
movslq 0x2a0a(%rip),%rcx
mov    (%rax,%rcx,8),%rax
movsd  0x18(%rax),%xmm2
lea    0x9a9(%rip),%rdi
lea    0x2deb(%rip),%rdx
mov    $0x3,%al
call   1040 <printf@plt>
mov    0x29e6(%rip),%eax
add    $0x1,%eax
mov    %eax,0x29dd(%rip)
jmp    14c6 <main+0x346>
movl   $0x0,0x29ce(%rip)
mov    0x29c8(%rip),%eax
cmp    0x29ba(%rip),%eax
jg     16e7 <main+0x567>
mov    0x2a55(%rip),%rax
movslq 0x29ae(%rip),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    0x299f(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2996(%rip)
jmp    16aa <main+0x52a>
mov    0x2a2a(%rip),%rdi
call   1030 <free@plt>
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0xe86(%rip),%rbx
lea    0x310c(%rip),%rsi
lea    0x310d(%rip),%rdx
lea    0x310e(%rip),%rcx
xor    %r14d,%r14d
mov    %rbx,%rdi
xor    %eax,%eax
call   1070 <scanf@plt>
lea    0x3102(%rip),%rsi
lea    0x3103(%rip),%rdx
lea    0x3104(%rip),%rcx
mov    %rbx,%rdi
xor    %eax,%eax
call   1070 <scanf@plt>
lea    0xe33(%rip),%rdi
lea    0x2e8c(%rip),%rsi
xor    %eax,%eax
call   1070 <scanf@plt>
mov    0x2e7f(%rip),%ebx
lea    0x1(%rbx),%r15d
movslq %r15d,%rdi
shl    $0x3,%rdi
call   1060 <malloc@plt>
mov    %rax,0x2e90(%rip)
test   %ebx,%ebx
js     123a <main+0xba>
mov    %rax,%r12
mov    %r15d,%ebp
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    $0x20,%edi
call   1060 <malloc@plt>
mov    %rax,(%r12,%rbx,8)
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    1220 <main+0xa0>
mov    %r15d,%r14d
mov    %r14d,0x2e33(%rip)
movsd  0xdb7(%rip),%xmm1
movsd  0x306f(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  0xdab(%rip),%xmm2
divsd  %xmm2,%xmm0
movsd  %xmm0,0x3057(%rip)
movsd  0x3057(%rip),%xmm0
mulsd  %xmm1,%xmm0
divsd  %xmm2,%xmm0
mulsd  0x304f(%rip),%xmm1
movsd  %xmm0,0x303f(%rip)
divsd  %xmm2,%xmm1
movsd  %xmm1,0x303b(%rip)
movsd  0x300b(%rip),%xmm1
movsd  %xmm1,(%rsp)
call   1080 <cos@plt>
mulsd  (%rsp),%xmm0
movsd  %xmm0,0x2df4(%rip)
movsd  0x2fec(%rip),%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  0x3006(%rip),%xmm0
call   1080 <cos@plt>
movsd  %xmm0,(%rsp)
movsd  0x2dcc(%rip),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x2fd6(%rip),%xmm0
call   1080 <cos@plt>
mulsd  0x8(%rsp),%xmm0
movsd  (%rsp),%xmm1
mulsd  0x10(%rsp),%xmm1
subsd  %xmm0,%xmm1
movsd  %xmm1,(%rsp)
movsd  0x2faf(%rip),%xmm0
call   1050 <sin@plt>
movsd  (%rsp),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,0x2de1(%rip)
movapd %xmm1,%xmm2
movsd  0x2f75(%rip),%xmm0
movsd  0x2d6d(%rip),%xmm1
mulsd  %xmm1,%xmm1
mulsd  %xmm0,%xmm0
subsd  %xmm1,%xmm0
mulsd  %xmm2,%xmm2
subsd  %xmm2,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     135f <main+0x1df>
sqrtsd %xmm0,%xmm0
jmp    1364 <main+0x1e4>
call   1090 <sqrt@plt>
movsd  %xmm0,0x2d6c(%rip)
lea    0x2d5d(%rip),%rbx
movsd  0x2f35(%rip),%xmm0
movsd  %xmm0,(%rsp)
movsd  0x2f38(%rip),%xmm0
call   1080 <cos@plt>
mulsd  (%rsp),%xmm0
movsd  %xmm0,0x2d16(%rip)
lea    0x2cff(%rip),%rbp
movq   $0x0,0x2d34(%rip)
movsd  0x2efc(%rip),%xmm0
movsd  %xmm0,(%rsp)
movsd  0x2eff(%rip),%xmm0
call   1050 <sin@plt>
mulsd  (%rsp),%xmm0
movsd  %xmm0,0x2d3d(%rip)
lea    0x2d26(%rip),%r9
movsd  0x2ed6(%rip),%xmm0
movsd  %xmm0,0x2cce(%rip)
movq   $0x0,0x2cf3(%rip)
movq   $0x0,0x2d18(%rip)
lea    0x2d29(%rip),%rdi
lea    0x2da2(%rip),%rsi
lea    0x2e1b(%rip),%rdx
mov    %rbp,%rcx
mov    %rbx,%r8
xor    %eax,%eax
call   10a0 <ATV@plt>
movl   $0x1,0x2c48(%rip)
mov    0x2c3e(%rip),%eax
test   %eax,%eax
jle    1574 <main+0x3f4>
lea    0x2c37(%rip),%r15
lea    0x2e98(%rip),%rbx
lea    0x2c31(%rip),%r12
lea    0x2c32(%rip),%r13
lea    0x2c33(%rip),%rbp
lea    0xbc3(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
lea    0xb9c(%rip),%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
mov    %r12,%rcx
mov    %r13,%r8
mov    %rbp,%r9
xor    %eax,%eax
call   1070 <scanf@plt>
movsd  0x2be3(%rip),%xmm0
mov    0x2bfc(%rip),%rax
movslq 0x2bd1(%rip),%rsi
mov    (%rax,%rsi,8),%rax
movsd  %xmm0,(%rax)
movsd  0x2bcd(%rip),%xmm3
movsd  0x2bcd(%rip),%xmm4
movsd  0x2bed(%rip),%xmm0
mulsd  %xmm4,%xmm0
movsd  0x2bd9(%rip),%xmm1
mulsd  %xmm3,%xmm1
addsd  %xmm0,%xmm1
movsd  0x2bb1(%rip),%xmm2
movsd  0x2bd1(%rip),%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,0x8(%rax)
movsd  0x2be4(%rip),%xmm1
mulsd  %xmm4,%xmm1
movsd  0x2bd0(%rip),%xmm5
mulsd  %xmm3,%xmm5
addsd  %xmm1,%xmm5
movsd  0x2bd0(%rip),%xmm1
mulsd  %xmm2,%xmm1
addsd  %xmm5,%xmm1
movsd  %xmm1,0x10(%rax)
mulsd  0x2be3(%rip),%xmm4
mulsd  0x2bd3(%rip),%xmm3
addsd  %xmm4,%xmm3
mulsd  0x2bd7(%rip),%xmm2
addsd  %xmm3,%xmm2
movsd  %xmm2,0x18(%rax)
mov    %r14,%rdi
mov    %rbx,%rdx
mov    $0x3,%al
call   1040 <printf@plt>
mov    0x2b17(%rip),%ecx
lea    0x1(%rcx),%eax
mov    %eax,0x2b0e(%rip)
mov    0x2b04(%rip),%eax
cmp    %eax,%ecx
jl     1470 <main+0x2f0>
test   %eax,%eax
js     15ae <main+0x42e>
mov    0x2b19(%rip),%rbx
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rax,%rbp
mov    (%rbx,%rax,8),%rdi
call   1030 <free@plt>
lea    0x1(%rbp),%rax
movslq 0x2ac9(%rip),%rcx
cmp    %rcx,%rbp
jl     1590 <main+0x410>
jmp    15b7 <main+0x437>
xor    %eax,%eax
mov    0x2ae1(%rip),%rbx
mov    %eax,0x2ab7(%rip)
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@main.atomnum = internal global i32 0
@main.n = internal global i32 0
@main.i = internal global i32 0
@main.j = internal global i32 0
@main.k = internal global i32 0
@main.l = internal global i32 0
@main.m = internal global i32 0
@main.i1 = internal global i32 0
@main.i2 = internal global i32 0
@main.j1 = internal global i32 0
@main.j2 = internal global i32 0
@main.za0 = internal global double 0.000000e+00
@main.za1 = internal global double 0.000000e+00
@main.za2 = internal global double 0.000000e+00
@main.za3 = internal global double 0.000000e+00
@main.ka1 = internal global double 0.000000e+00
@main.ka2 = internal global double 0.000000e+00
@main.ka3 = internal global double 0.000000e+00
@main.al = internal global double 0.000000e+00
@main.be = internal global double 0.000000e+00
@main.ga = internal global double 0.000000e+00
@main.c1 = internal global double 0.000000e+00
@main.c2 = internal global double 0.000000e+00
@main.c3 = internal global double 0.000000e+00
@main.s2 = internal global double 0.000000e+00
@main.s3 = internal global double 0.000000e+00
@main.xyz = internal global double** null
@main.rxyz = internal global [10 x double] zeroinitializer
@main.tvxyz = internal global [5 x [4 x double]] zeroinitializer
@main.tvx = internal global [5 x double] zeroinitializer
@main.tvy = internal global [5 x double] zeroinitializer
@main.tvz = internal global [5 x double] zeroinitializer
@main.atvx = internal global [15 x double] zeroinitializer
@main.atvy = internal global [15 x double] zeroinitializer
@main.atvz = internal global [15 x double] zeroinitializer
@main.la1 = internal global double 0.000000e+00
@main.la2 = internal global double 0.000000e+00
@main.la3 = internal global double 0.000000e+00
@main.ang1 = internal global double 0.000000e+00
@main.ang2 = internal global double 0.000000e+00
@main.ang3 = internal global double 0.000000e+00
@main.r = internal global double 0.000000e+00
@main.dx = internal global double 0.000000e+00
@main.dy = internal global double 0.000000e+00
@main.dz = internal global double 0.000000e+00
@main.Name = internal global [100 x i8] zeroinitializer
@.str = [12 x i8] c"%lf %lf %lf\00"
@.str.1 = [3 x i8] c"%i\00"
@.str.2 = [20 x i8] c"%lf %s %lf %lf %lf\00"
@.str.3 = [37 x i8] c"%4d %3s %16.12f %16.12f %16.12f\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), double* @main.la1, double* @main.la2, double* @main.la3)
%3 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), double* @main.ang1, double* @main.ang2, double* @main.ang3)
%4 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* @main.atomnum)
%5 = load i32, i32* @main.atomnum
%6 = add nsw i32 %5, 1
%7 = sext i32 %6 to i64
%8 = mul i64 8, %7
%9 = call i8* @malloc(i64 %8)
%10 = bitcast i8* %9 to double**
store double** %10, double*** @main.xyz
store i32 0, i32* @main.i
br label %11
11: ; preds = %22, %0
%12 = load i32, i32* @main.i
%13 = load i32, i32* @main.atomnum
%14 = icmp sle i32 %12, %13
br i1 %14, label %15, label %25
15: ; preds = %11
%16 = call i8* @malloc(i64 32)
%17 = bitcast i8* %16 to double*
%18 = load double**, double*** @main.xyz
%19 = load i32, i32* @main.i
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds double*, double** %18, i64 %20
store double* %17, double** %21
br label %22
22: ; preds = %15
%23 = load i32, i32* @main.i
%24 = add nsw i32 %23, 1
store i32 %24, i32* @main.i
br label %11
25: ; preds = %11
%26 = load double, double* @main.ang1
%27 = fmul double 0x400921FB54442D18, %26
%28 = fdiv double %27, 1.800000e+02
store double %28, double* @main.ang1
%29 = load double, double* @main.ang2
%30 = fmul double 0x400921FB54442D18, %29
%31 = fdiv double %30, 1.800000e+02
store double %31, double* @main.ang2
%32 = load double, double* @main.ang3
%33 = fmul double 0x400921FB54442D18, %32
%34 = fdiv double %33, 1.800000e+02
store double %34, double* @main.ang3
%35 = load double, double* @main.la1
%36 = load double, double* @main.ang2
%37 = call double @cos(double %36)
%38 = fmul double %35, %37
store double %38, double* getelementptr inbounds ([5 x double], [5 x double]* @main.tvx, i64 0, i64 1)
%39 = load double, double* @main.la1
%40 = load double, double* @main.ang3
%41 = call double @cos(double %40)
%42 = load double, double* getelementptr inbounds ([5 x double], [5 x double]* @main.tvx, i64 0, i64 1)
%43 = load double, double* @main.ang1
%44 = call double @cos(double %43)
%45 = fmul double %42, %44
%46 = fneg double %45
%47 = call double @llvm.fmuladd.f64(double %39, double %41, double %46)
%48 = load double, double* @main.ang1
%49 = call double @sin(double %48)
%50 = fdiv double %47, %49
store double %50, double* getelementptr inbounds ([5 x double], [5 x double]* @main.tvz, i64 0, i64 1)
%51 = load double, double* @main.la1
%52 = load double, double* @main.la1
%53 = load double, double* getelementptr inbounds ([5 x double], [5 x double]* @main.tvx, i64 0, i64 1)
%54 = load double, double* getelementptr inbounds ([5 x double], [5 x double]* @main.tvx, i64 0, i64 1)
%55 = fmul double %53, %54
%56 = fneg double %55
%57 = call double @llvm.fmuladd.f64(double %51, double %52, double %56)
%58 = load double, double* getelementptr inbounds ([5 x double], [5 x double]* @main.tvz, i64 0, i64 1)
%59 = load double, double* getelementptr inbounds ([5 x double], [5 x double]* @main.tvz, i64 0, i64 1)
%60 = fneg double %58
%61 = call double @llvm.fmuladd.f64(double %60, double %59, double %57)
%62 = call double @sqrt(double %61)
store double %62, double* getelementptr inbounds ([5 x double], [5 x double]* @main.tvy, i64 0, i64 1)
%63 = load double, double* @main.la2
%64 = load double, double* @main.ang1
%65 = call double @cos(double %64)
%66 = fmul double %63, %65
store double %66, double* getelementptr inbounds ([5 x double], [5 x double]* @main.tvx, i64 0, i64 2)
store double 0.000000e+00, double* getelementptr inbounds ([5 x double], [5 x double]* @main.tvy, i64 0, i64 2)
%67 = load double, double* @main.la2
%68 = load double, double* @main.ang1
%69 = call double @sin(double %68)
%70 = fmul double %67, %69
store double %70, double* getelementptr inbounds ([5 x double], [5 x double]* @main.tvz, i64 0, i64 2)
%71 = load double, double* @main.la3
store double %71, double* getelementptr inbounds ([5 x double], [5 x double]* @main.tvx, i64 0, i64 3)
store double 0.000000e+00, double* getelementptr inbounds ([5 x double], [5 x double]* @main.tvy, i64 0, i64 3)
store double 0.000000e+00, double* getelementptr inbounds ([5 x double], [5 x double]* @main.tvz, i64 0, i64 3)
%72 = call i32 (double*, double*, double*, double*, double*, double*, ...) bitcast (i32 (...)* @ATV to i32 (double*, double*, double*, double*, double*, double*, ...)*)(double* getelementptr inbounds ([15 x double], [15 x double]* @main.atvx, i64 0, i64 0), double* getelementptr inbounds ([15 x double], [15 x double]* @main.atvy, i64 0, i64 0), double* getelementptr inbounds ([15 x double], [15 x double]* @main.atvz, i64 0, i64 0), double* getelementptr inbounds ([5 x double], [5 x double]* @main.tvx, i64 0, i64 0), double* getelementptr inbounds ([5 x double], [5 x double]* @main.tvy, i64 0, i64 0), double* getelementptr inbounds ([5 x double], [5 x double]* @main.tvz, i64 0, i64 0))
store i32 1, i32* @main.i
br label %73
73: ; preds = %154, %25
%74 = load i32, i32* @main.i
%75 = load i32, i32* @main.atomnum
%76 = icmp sle i32 %74, %75
br i1 %76, label %77, label %157
77: ; preds = %73
%78 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), double* @main.za0, [100 x i8]* @main.Name, double* @main.za1, double* @main.za2, double* @main.za3)
%79 = load double, double* @main.za0
%80 = load double**, double*** @main.xyz
%81 = load i32, i32* @main.i
%82 = sext i32 %81 to i64
%83 = getelementptr inbounds double*, double** %80, i64 %82
%84 = load double*, double** %83
%85 = getelementptr inbounds double, double* %84, i64 0
store double %79, double* %85
%86 = load double, double* @main.za1
%87 = load double, double* getelementptr inbounds ([5 x double], [5 x double]* @main.tvx, i64 0, i64 1)
%88 = load double, double* @main.za2
%89 = load double, double* getelementptr inbounds ([5 x double], [5 x double]* @main.tvx, i64 0, i64 2)
%90 = fmul double %88, %89
%91 = call double @llvm.fmuladd.f64(double %86, double %87, double %90)
%92 = load double, double* @main.za3
%93 = load double, double* getelementptr inbounds ([5 x double], [5 x double]* @main.tvx, i64 0, i64 3)
%94 = call double @llvm.fmuladd.f64(double %92, double %93, double %91)
%95 = load double**, double*** @main.xyz
%96 = load i32, i32* @main.i
%97 = sext i32 %96 to i64
%98 = getelementptr inbounds double*, double** %95, i64 %97
%99 = load double*, double** %98
%100 = getelementptr inbounds double, double* %99, i64 1
store double %94, double* %100
%101 = load double, double* @main.za1
%102 = load double, double* getelementptr inbounds ([5 x double], [5 x double]* @main.tvy, i64 0, i64 1)
%103 = load double, double* @main.za2
%104 = load double, double* getelementptr inbounds ([5 x double], [5 x double]* @main.tvy, i64 0, i64 2)
%105 = fmul double %103, %104
%106 = call double @llvm.fmuladd.f64(double %101, double %102, double %105)
%107 = load double, double* @main.za3
%108 = load double, double* getelementptr inbounds ([5 x double], [5 x double]* @main.tvy, i64 0, i64 3)
%109 = call double @llvm.fmuladd.f64(double %107, double %108, double %106)
%110 = load double**, double*** @main.xyz
%111 = load i32, i32* @main.i
%112 = sext i32 %111 to i64
%113 = getelementptr inbounds double*, double** %110, i64 %112
%114 = load double*, double** %113
%115 = getelementptr inbounds double, double* %114, i64 2
store double %109, double* %115
%116 = load double, double* @main.za1
%117 = load double, double* getelementptr inbounds ([5 x double], [5 x double]* @main.tvz, i64 0, i64 1)
%118 = load double, double* @main.za2
%119 = load double, double* getelementptr inbounds ([5 x double], [5 x double]* @main.tvz, i64 0, i64 2)
%120 = fmul double %118, %119
%121 = call double @llvm.fmuladd.f64(double %116, double %117, double %120)
%122 = load double, double* @main.za3
%123 = load double, double* getelementptr inbounds ([5 x double], [5 x double]* @main.tvz, i64 0, i64 3)
%124 = call double @llvm.fmuladd.f64(double %122, double %123, double %121)
%125 = load double**, double*** @main.xyz
%126 = load i32, i32* @main.i
%127 = sext i32 %126 to i64
%128 = getelementptr inbounds double*, double** %125, i64 %127
%129 = load double*, double** %128
%130 = getelementptr inbounds double, double* %129, i64 3
store double %124, double* %130
%131 = load i32, i32* @main.i
%132 = load double**, double*** @main.xyz
%133 = load i32, i32* @main.i
%134 = sext i32 %133 to i64
%135 = getelementptr inbounds double*, double** %132, i64 %134
%136 = load double*, double** %135
%137 = getelementptr inbounds double, double* %136, i64 1
%138 = load double, double* %137
%139 = load double**, double*** @main.xyz
%140 = load i32, i32* @main.i
%141 = sext i32 %140 to i64
%142 = getelementptr inbounds double*, double** %139, i64 %141
%143 = load double*, double** %142
%144 = getelementptr inbounds double, double* %143, i64 2
%145 = load double, double* %144
%146 = load double**, double*** @main.xyz
%147 = load i32, i32* @main.i
%148 = sext i32 %147 to i64
%149 = getelementptr inbounds double*, double** %146, i64 %148
%150 = load double*, double** %149
%151 = getelementptr inbounds double, double* %150, i64 3
%152 = load double, double* %151
%153 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.3, i64 0, i64 0), i32 %131, i8* getelementptr inbounds ([100 x i8], [100 x i8]* @main.Name, i64 0, i64 0), double %138, double %145, double %152)
br label %154
154: ; preds = %77
%155 = load i32, i32* @main.i
%156 = add nsw i32 %155, 1
store i32 %156, i32* @main.i
br label %73
157: ; preds = %73
store i32 0, i32* @main.i
br label %158
158: ; preds = %169, %157
%159 = load i32, i32* @main.i
%160 = load i32, i32* @main.atomnum
%161 = icmp sle i32 %159, %160
br i1 %161, label %162, label %172
162: ; preds = %158
%163 = load double**, double*** @main.xyz
%164 = load i32, i32* @main.i
%165 = sext i32 %164 to i64
%166 = getelementptr inbounds double*, double** %163, i64 %165
%167 = load double*, double** %166
%168 = bitcast double* %167 to i8*
br label %169
169: ; preds = %162
%170 = load i32, i32* @main.i
%171 = add nsw i32 %170, 1
store i32 %171, i32* @main.i
br label %158
172: ; preds = %158
%173 = load double**, double*** @main.xyz
%174 = bitcast double** %173 to i8*
%175 = load i32, i32* %1
ret i32 %175
}

LLVM IR (-O2):
@main.atomnum = internal global i32 0
@main.i = internal unnamed_addr global i32 0
@main.za0 = internal global double 0.000000e+00
@main.za1 = internal global double 0.000000e+00
@main.za2 = internal global double 0.000000e+00
@main.za3 = internal global double 0.000000e+00
@main.xyz = internal unnamed_addr global double** null
@main.tvx = internal global [5 x double] zeroinitializer
@main.tvy = internal global [5 x double] zeroinitializer
@main.tvz = internal global [5 x double] zeroinitializer
@main.atvx = internal global [15 x double] zeroinitializer
@main.atvy = internal global [15 x double] zeroinitializer
@main.atvz = internal global [15 x double] zeroinitializer
@main.la1 = internal global double 0.000000e+00
@main.la2 = internal global double 0.000000e+00
@main.la3 = internal global double 0.000000e+00
@main.ang1 = internal global double 0.000000e+00
@main.ang2 = internal global double 0.000000e+00
@main.ang3 = internal global double 0.000000e+00
@main.Name = internal global [100 x i8] zeroinitializer
@.str = [12 x i8] c"%lf %lf %lf\00"
@.str.1 = [3 x i8] c"%i\00"
@.str.2 = [20 x i8] c"%lf %s %lf %lf %lf\00"
@.str.3 = [37 x i8] c"%4d %3s %16.12f %16.12f %16.12f\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), double* @main.la1, double* @main.la2, double* @main.la3)
%2 = tail call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), double* @main.ang1, double* @main.ang2, double* @main.ang3)
%3 = tail call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* @main.atomnum)
%4 = load i32, i32* @main.atomnum
%5 = add i32 %4, 1
%6 = sext i32 %5 to i64
%7 = shl nsw i64 %6, 3
%8 = tail call i8* @malloc(i64 %7)
store i8* %8, i8** bitcast (double*** @main.xyz to i8**)
%9 = icmp slt i32 %4, 0
%10 = bitcast i8* %8 to double**
br i1 %9, label %20, label %11
11: ; preds = %0
%12 = zext i32 %5 to i64
br label %13
13: ; preds = %11, %13
%14 = phi i64 [ 0, %11 ], [ %18, %13 ]
%15 = tail call dereferenceable_or_null(32) i8* @malloc(i64 32)
%16 = getelementptr inbounds double*, double** %10, i64 %14
%17 = bitcast double** %16 to i8**
store i8* %15, i8** %17
%18 = add nuw nsw i64 %14, 1
%19 = icmp eq i64 %18, %12
br i1 %19, label %20, label %13
20: ; preds = %13, %0
%21 = phi i32 [ 0, %0 ], [ %5, %13 ]
store i32 %21, i32* @main.i
%22 = load double, double* @main.ang1
%23 = fmul double %22, 0x400921FB54442D18
%24 = fdiv double %23, 1.800000e+02
store double %24, double* @main.ang1
%25 = load double, double* @main.ang2
%26 = fmul double %25, 0x400921FB54442D18
%27 = fdiv double %26, 1.800000e+02
store double %27, double* @main.ang2
%28 = load double, double* @main.ang3
%29 = fmul double %28, 0x400921FB54442D18
%30 = fdiv double %29, 1.800000e+02
store double %30, double* @main.ang3
%31 = load double, double* @main.la1
%32 = tail call double @cos(double %27)
%33 = fmul double %31, %32
store double %33, double* getelementptr inbounds ([5 x double], [5 x double]* @main.tvx, i64 0, i64 1)
%34 = load double, double* @main.la1
%35 = load double, double* @main.ang3
%36 = tail call double @cos(double %35)
%37 = load double, double* getelementptr inbounds ([5 x double], [5 x double]* @main.tvx, i64 0, i64 1)
%38 = load double, double* @main.ang1
%39 = tail call double @cos(double %38)
%40 = fneg double %37
%41 = fmul double %39, %40
%42 = tail call double @llvm.fmuladd.f64(double %34, double %36, double %41)
%43 = load double, double* @main.ang1
%44 = tail call double @sin(double %43)
%45 = fdiv double %42, %44
store double %45, double* getelementptr inbounds ([5 x double], [5 x double]* @main.tvz, i64 0, i64 1)
%46 = load double, double* @main.la1
%47 = load double, double* getelementptr inbounds ([5 x double], [5 x double]* @main.tvx, i64 0, i64 1)
%48 = fneg double %47
%49 = fmul double %47, %48
%50 = tail call double @llvm.fmuladd.f64(double %46, double %46, double %49)
%51 = fneg double %45
%52 = tail call double @llvm.fmuladd.f64(double %51, double %45, double %50)
%53 = tail call double @sqrt(double %52)
store double %53, double* getelementptr inbounds ([5 x double], [5 x double]* @main.tvy, i64 0, i64 1)
%54 = load double, double* @main.la2
%55 = load double, double* @main.ang1
%56 = tail call double @cos(double %55)
%57 = fmul double %54, %56
store double %57, double* getelementptr inbounds ([5 x double], [5 x double]* @main.tvx, i64 0, i64 2)
store double 0.000000e+00, double* getelementptr inbounds ([5 x double], [5 x double]* @main.tvy, i64 0, i64 2)
%58 = load double, double* @main.la2
%59 = load double, double* @main.ang1
%60 = tail call double @sin(double %59)
%61 = fmul double %58, %60
store double %61, double* getelementptr inbounds ([5 x double], [5 x double]* @main.tvz, i64 0, i64 2)
%62 = load double, double* @main.la3
store double %62, double* getelementptr inbounds ([5 x double], [5 x double]* @main.tvx, i64 0, i64 3)
store double 0.000000e+00, double* getelementptr inbounds ([5 x double], [5 x double]* @main.tvy, i64 0, i64 3)
store double 0.000000e+00, double* getelementptr inbounds ([5 x double], [5 x double]* @main.tvz, i64 0, i64 3)
%63 = tail call i32 (double*, double*, double*, double*, double*, double*, ...) bitcast (i32 (...)* @ATV to i32 (double*, double*, double*, double*, double*, double*, ...)*)(double* getelementptr inbounds ([15 x double], [15 x double]* @main.atvx, i64 0, i64 0), double* getelementptr inbounds ([15 x double], [15 x double]* @main.atvy, i64 0, i64 0), double* getelementptr inbounds ([15 x double], [15 x double]* @main.atvz, i64 0, i64 0), double* getelementptr inbounds ([5 x double], [5 x double]* @main.tvx, i64 0, i64 0), double* getelementptr inbounds ([5 x double], [5 x double]* @main.tvy, i64 0, i64 0), double* getelementptr inbounds ([5 x double], [5 x double]* @main.tvz, i64 0, i64 0))
store i32 1, i32* @main.i
%64 = load i32, i32* @main.atomnum
%65 = icmp slt i32 %64, 1
br i1 %65, label %66, label %74
66: ; preds = %74, %20
%67 = phi i32 [ %64, %20 ], [ %109, %74 ]
%68 = icmp slt i32 %67, 0
br i1 %68, label %69, label %71
69: ; preds = %66
%70 = load i8*, i8** bitcast (double*** @main.xyz to i8**)
br label %122
71: ; preds = %66
%72 = load double**, double*** @main.xyz
%73 = bitcast double** %72 to i8*
br label %111
74: ; preds = %20, %74
%75 = tail call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), double* @main.za0, [100 x i8]* @main.Name, double* @main.za1, double* @main.za2, double* @main.za3)
%76 = load double, double* @main.za0
%77 = load double**, double*** @main.xyz
%78 = load i32, i32* @main.i
%79 = sext i32 %78 to i64
%80 = getelementptr inbounds double*, double** %77, i64 %79
%81 = load double*, double** %80
store double %76, double* %81
%82 = load double, double* @main.za1
%83 = load double, double* getelementptr inbounds ([5 x double], [5 x double]* @main.tvx, i64 0, i64 1)
%84 = load double, double* @main.za2
%85 = load double, double* getelementptr inbounds ([5 x double], [5 x double]* @main.tvx, i64 0, i64 2)
%86 = fmul double %84, %85
%87 = tail call double @llvm.fmuladd.f64(double %82, double %83, double %86)
%88 = load double, double* @main.za3
%89 = load double, double* getelementptr inbounds ([5 x double], [5 x double]* @main.tvx, i64 0, i64 3)
%90 = tail call double @llvm.fmuladd.f64(double %88, double %89, double %87)
%91 = getelementptr inbounds double, double* %81, i64 1
store double %90, double* %91
%92 = load double, double* getelementptr inbounds ([5 x double], [5 x double]* @main.tvy, i64 0, i64 1)
%93 = load double, double* getelementptr inbounds ([5 x double], [5 x double]* @main.tvy, i64 0, i64 2)
%94 = fmul double %84, %93
%95 = tail call double @llvm.fmuladd.f64(double %82, double %92, double %94)
%96 = load double, double* getelementptr inbounds ([5 x double], [5 x double]* @main.tvy, i64 0, i64 3)
%97 = tail call double @llvm.fmuladd.f64(double %88, double %96, double %95)
%98 = getelementptr inbounds double, double* %81, i64 2
store double %97, double* %98
%99 = load double, double* getelementptr inbounds ([5 x double], [5 x double]* @main.tvz, i64 0, i64 1)
%100 = load double, double* getelementptr inbounds ([5 x double], [5 x double]* @main.tvz, i64 0, i64 2)
%101 = fmul double %84, %100
%102 = tail call double @llvm.fmuladd.f64(double %82, double %99, double %101)
%103 = load double, double* getelementptr inbounds ([5 x double], [5 x double]* @main.tvz, i64 0, i64 3)
%104 = tail call double @llvm.fmuladd.f64(double %88, double %103, double %102)
%105 = getelementptr inbounds double, double* %81, i64 3
store double %104, double* %105
%106 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.3, i64 0, i64 0), i32 %78, i8* getelementptr inbounds ([100 x i8], [100 x i8]* @main.Name, i64 0, i64 0), double %90, double %97, double %104)
%107 = load i32, i32* @main.i
%108 = add nsw i32 %107, 1
store i32 %108, i32* @main.i
%109 = load i32, i32* @main.atomnum
%110 = icmp slt i32 %107, %109
br i1 %110, label %74, label %66
111: ; preds = %71, %111
%112 = phi i64 [ 0, %71 ], [ %116, %111 ]
%113 = getelementptr inbounds double*, double** %72, i64 %112
%114 = bitcast double** %113 to i8**
%115 = load i8*, i8** %114
tail call void @free(i8* %115)
%116 = add nuw nsw i64 %112, 1
%117 = load i32, i32* @main.atomnum
%118 = sext i32 %117 to i64
%119 = icmp slt i64 %112, %118
br i1 %119, label %111, label %120
120: ; preds = %111
%121 = trunc i64 %116 to i32
br label %122
122: ; preds = %69, %120
%123 = phi i8* [ %70, %69 ], [ %73, %120 ]
%124 = phi i32 [ 0, %69 ], [ %121, %120 ]
store i32 %124, i32* @main.i
tail call void @free(i8* %123)
ret i32 0
}