#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*/ printf(char *, ...);
int spg_get_symmetry(int ***, double **, int, double **, double **, int *, int,
                     int);
void test_spg_get_symmetry(void) {
  double lattice[3][3] = {{4, 0, 0}, {0, 4, 0}, {0, 0, 3}};
  double position[][3] = {{0, 0, 0},       {0.5, 0.5, 0.25}, {0.3, 0.3, 0},
                          {0.7, 0.7, 0},   {0.2, 0.8, 0.25}, {0.8, 0.2, 0.25},
                          {0, 0, 0.5},     {0.5, 0.5, 0.75}, {0.3, 0.3, 0.5},
                          {0.7, 0.7, 0.5}, {0.2, 0.8, 0.75}, {0.8, 0.2, 0.75}};
  int types[] = {1, 1, 2, 2, 2, 2, 1, 1, 2, 2, 2, 2};
  int num_atom = 12;
  int max_size = 50;
  int i, j, size;
  int rotation[max_size][3][3];
  double translation[max_size][3];
  double origin_shift[3] = {0.1, 0.1, 0};
  for (i = 0; i < num_atom; i++) {
    for (j = 0; j < 3; j++) {
      position[i][j] += origin_shift[j];
    }
  }
  printf("*** Example of spg_get_symmetry (Rutile two unit cells) ***:\n");
  size = spg_get_symmetry(rotation, translation, max_size, lattice, position,
                          types, num_atom, 1e-5);
  for (i = 0; i < size; i++) {
    printf("--- %d ---\n", i + 1);
    for (j = 0; j < 3; j++)
      printf("%2d %2d %2d\n", rotation[i][j][0], rotation[i][j][1],
             rotation[i][j][2]);
    printf("%f %f %f\n", translation[i][0], translation[i][1],
           translation[i][2]);
  }
}


x86 assembly (clang, -O0):
<test_spg_get_symmetry>:
push   %rbp
mov    %rsp,%rbp
sub    $0x200,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,-0x20(%rbp)
movaps %xmm0,-0x30(%rbp)
movaps %xmm0,-0x40(%rbp)
movaps %xmm0,-0x50(%rbp)
movq   $0x0,-0x10(%rbp)
movabs $0x4010000000000000,%rax
mov    %rax,-0x50(%rbp)
mov    %rax,-0x30(%rbp)
movabs $0x4008000000000000,%rax
mov    %rax,-0x10(%rbp)
lea    0xe83(%rip),%rsi
lea    -0x170(%rbp),%rdi
mov    $0x120,%edx
call   1050 <memcpy@plt>
movaps 0xfab(%rip),%xmm0
movaps %xmm0,-0x180(%rbp)
movaps 0xf8d(%rip),%xmm0
movaps %xmm0,-0x190(%rbp)
movaps 0xf6f(%rip),%xmm0
movaps %xmm0,-0x1a0(%rbp)
movl   $0xc,-0x1a4(%rbp)
movl   $0x32,-0x1a8(%rbp)
mov    -0x1a8(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x1c0(%rbp)
lea    (%rax,%rax,8),%rcx
lea    0xf(,%rcx,4),%rdx
movabs $0x7ffffffff0,%rcx
and    %rcx,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x200(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x1c8(%rbp)
mov    -0x1a8(%rbp),%eax
lea    (%rax,%rax,2),%rcx
lea    0xf(,%rcx,8),%rdx
movabs $0x3ffffffff0,%rcx
and    %rcx,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x1f8(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x1d0(%rbp)
mov    0xf07(%rip),%rax
mov    %rax,-0x1f0(%rbp)
mov    0xf01(%rip),%rax
mov    %rax,-0x1e8(%rbp)
mov    0xefb(%rip),%rax
mov    %rax,-0x1e0(%rbp)
movl   $0x0,-0x1ac(%rbp)
mov    -0x1ac(%rbp),%eax
cmp    -0x1a4(%rbp),%eax
jge    1302 <test_spg_get_symmetry+0x1d2>
movl   $0x0,-0x1b0(%rbp)
cmpl   $0x3,-0x1b0(%rbp)
jge    12e9 <test_spg_get_symmetry+0x1b9>
movslq -0x1b0(%rbp),%rax
movsd  -0x1f0(%rbp,%rax,8),%xmm0
ff ff
movslq -0x1ac(%rbp),%rcx
lea    -0x170(%rbp),%rax
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
movslq -0x1b0(%rbp),%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x1b0(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1b0(%rbp)
jmp    1292 <test_spg_get_symmetry+0x162>
jmp    12ee <test_spg_get_symmetry+0x1be>
mov    -0x1ac(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1ac(%rbp)
jmp    1276 <test_spg_get_symmetry+0x146>
lea    0xe5f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x200(%rbp),%rdi
mov    -0x1f8(%rbp),%rsi
mov    -0x1a8(%rbp),%edx
lea    -0x50(%rbp),%rcx
lea    -0x170(%rbp),%r8
lea    -0x1a0(%rbp),%r9
mov    -0x1a4(%rbp),%eax
xor    %r10d,%r10d
sub    $0x10,%rsp
mov    %eax,(%rsp)
movl   $0x0,0x8(%rsp)
call   1040 <spg_get_symmetry@plt>
add    $0x10,%rsp
mov    %eax,-0x1b4(%rbp)
movl   $0x0,-0x1ac(%rbp)
mov    -0x1ac(%rbp),%eax
cmp    -0x1b4(%rbp),%eax
jge    1499 <test_spg_get_symmetry+0x369>
mov    -0x1ac(%rbp),%esi
add    $0x1,%esi
lea    0xe1d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x1b0(%rbp)
cmpl   $0x3,-0x1b0(%rbp)
jge    1432 <test_spg_get_symmetry+0x302>
mov    -0x200(%rbp),%rax
movslq -0x1ac(%rbp),%rcx
imul   $0x24,%rcx,%rdx
mov    %rax,%rcx
add    %rdx,%rcx
movslq -0x1b0(%rbp),%rdx
imul   $0xc,%rdx,%rdx
add    %rdx,%rcx
mov    (%rcx),%esi
movslq -0x1ac(%rbp),%rcx
imul   $0x24,%rcx,%rdx
mov    %rax,%rcx
add    %rdx,%rcx
movslq -0x1b0(%rbp),%rdx
imul   $0xc,%rdx,%rdx
add    %rdx,%rcx
mov    0x4(%rcx),%edx
movslq -0x1ac(%rbp),%rcx
imul   $0x24,%rcx,%rcx
add    %rcx,%rax
movslq -0x1b0(%rbp),%rcx
imul   $0xc,%rcx,%rcx
add    %rcx,%rax
mov    0x8(%rax),%ecx
lea    0xd9b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1b0(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1b0(%rbp)
jmp    139a <test_spg_get_symmetry+0x26a>
mov    -0x1f8(%rbp),%rax
movslq -0x1ac(%rbp),%rcx
imul   $0x18,%rcx,%rdx
mov    %rax,%rcx
add    %rdx,%rcx
movsd  (%rcx),%xmm0
movslq -0x1ac(%rbp),%rcx
imul   $0x18,%rcx,%rdx
mov    %rax,%rcx
add    %rdx,%rcx
movsd  0x8(%rcx),%xmm1
movslq -0x1ac(%rbp),%rcx
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
movsd  0x10(%rax),%xmm2
lea    0xd41(%rip),%rdi
mov    $0x3,%al
call   1030 <printf@plt>
mov    -0x1ac(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1ac(%rbp)
jmp    1367 <test_spg_get_symmetry+0x237>
mov    -0x1c0(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_spg_get_symmetry>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xd78,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x130(%rsp)
movaps %xmm0,0x150(%rsp)
movaps %xmm0,0x160(%rsp)
movaps %xmm0,0x140(%rsp)
movabs $0x4010000000000000,%rax
mov    %rax,0x130(%rsp)
mov    %rax,0x150(%rsp)
movabs $0x4008000000000000,%rax
mov    %rax,0x170(%rsp)
lea    0xe69(%rip),%rsi
lea    0x10(%rsp),%rbx
mov    $0x120,%edx
mov    %rbx,%rdi
call   1060 <memcpy@plt>
mov    %rsp,0x8(%rsp)
movaps 0xf8b(%rip),%xmm0
movaps %xmm0,0x1a0(%rsp)
movaps 0xf6c(%rip),%xmm0
movaps %xmm0,0x190(%rsp)
movaps 0xf4d(%rip),%xmm1
movsd  0x10(%rsp),%xmm2
movsd  0x18(%rsp),%xmm3
movsd  0x20(%rsp),%xmm4
movhpd 0x28(%rsp),%xmm2
movapd 0xdfd(%rip),%xmm0
addpd  %xmm0,%xmm2
movhpd 0x30(%rsp),%xmm3
addpd  %xmm0,%xmm3
movhpd 0x38(%rsp),%xmm4
xorpd  %xmm6,%xmm6
addpd  %xmm6,%xmm4
movapd %xmm2,%xmm5
unpcklpd %xmm3,%xmm5
movsd  %xmm4,%xmm2
movhlps %xmm3,%xmm4
movsd  0x40(%rsp),%xmm3
movaps %xmm4,0x30(%rsp)
movapd %xmm2,0x20(%rsp)
movapd %xmm5,0x10(%rsp)
movhpd 0x58(%rsp),%xmm3
movaps %xmm1,0x180(%rsp)
movsd  0x48(%rsp),%xmm1
movhpd 0x60(%rsp),%xmm1
addpd  %xmm0,%xmm3
movsd  0x50(%rsp),%xmm2
movhpd 0x68(%rsp),%xmm2
addpd  %xmm0,%xmm1
addpd  %xmm6,%xmm2
xorpd  %xmm5,%xmm5
movapd %xmm1,%xmm4
unpckhpd %xmm2,%xmm4
shufpd $0x2,%xmm3,%xmm2
unpcklpd %xmm1,%xmm3
movapd %xmm3,0x40(%rsp)
movapd %xmm2,0x50(%rsp)
movapd %xmm4,0x60(%rsp)
movsd  0x70(%rsp),%xmm1
movhpd 0x88(%rsp),%xmm1
addpd  %xmm0,%xmm1
movsd  0x78(%rsp),%xmm2
movhpd 0x90(%rsp),%xmm2
addpd  %xmm0,%xmm2
movsd  0x80(%rsp),%xmm3
movhpd 0x98(%rsp),%xmm3
addpd  %xmm5,%xmm3
movapd %xmm2,%xmm4
unpckhpd %xmm3,%xmm4
shufpd $0x2,%xmm1,%xmm3
unpcklpd %xmm2,%xmm1
movapd %xmm1,0x70(%rsp)
movapd %xmm3,0x80(%rsp)
movapd %xmm4,0x90(%rsp)
movsd  0xa0(%rsp),%xmm1
movsd  0xa8(%rsp),%xmm2
movsd  0xb0(%rsp),%xmm3
movhpd 0xb8(%rsp),%xmm1
addpd  %xmm0,%xmm1
movhpd 0xc0(%rsp),%xmm2
movhpd 0xc8(%rsp),%xmm3
addpd  %xmm0,%xmm2
addpd  %xmm5,%xmm3
movapd %xmm1,%xmm4
unpcklpd %xmm2,%xmm4
movsd  %xmm3,%xmm1
movhlps %xmm2,%xmm3
movaps %xmm3,0xc0(%rsp)
movapd %xmm1,0xb0(%rsp)
movapd %xmm4,0xa0(%rsp)
movsd  0xd0(%rsp),%xmm1
movsd  0xd8(%rsp),%xmm2
movhpd 0xe8(%rsp),%xmm1
movsd  0xe0(%rsp),%xmm3
addpd  %xmm0,%xmm1
movhpd 0xf0(%rsp),%xmm2
addpd  %xmm0,%xmm2
movhpd 0xf8(%rsp),%xmm3
addpd  %xmm5,%xmm3
movapd %xmm1,%xmm4
unpcklpd %xmm2,%xmm4
movsd  %xmm3,%xmm1
movhlps %xmm2,%xmm3
movaps %xmm3,0xf0(%rsp)
movapd %xmm1,0xe0(%rsp)
movapd %xmm4,0xd0(%rsp)
movsd  0x100(%rsp),%xmm1
movsd  0x108(%rsp),%xmm2
movsd  0x110(%rsp),%xmm3
movhpd 0x118(%rsp),%xmm1
addpd  %xmm0,%xmm1
movhpd 0x120(%rsp),%xmm2
movhpd 0x128(%rsp),%xmm3
addpd  %xmm0,%xmm2
addpd  %xmm5,%xmm3
movapd %xmm1,%xmm0
unpcklpd %xmm2,%xmm0
movsd  %xmm3,%xmm1
movhlps %xmm2,%xmm3
movaps %xmm3,0x120(%rsp)
movapd %xmm1,0x110(%rsp)
movapd %xmm0,0x100(%rsp)
lea    0xd38(%rip),%rdi
call   1030 <puts@plt>
lea    0x1b0(%rsp),%rdi
lea    0x8c0(%rsp),%rsi
lea    0x130(%rsp),%rcx
lea    0x180(%rsp),%r9
mov    $0x32,%edx
mov    %rbx,%r8
push   $0x0
push   $0xc
call   1050 <spg_get_symmetry@plt>
add    $0x10,%rsp
test   %eax,%eax
jle    1563 <test_spg_get_symmetry+0x423>
mov    %eax,%eax
lea    0x8d0(%rsp),%rbp
shl    $0x2,%rax
lea    (%rax,%rax,8),%r13
mov    $0x1,%ebx
lea    0xcc1(%rip),%r15
lea    0xcc7(%rip),%r12
xor    %r14d,%r14d
cs nopw 0x0(%rax,%rax,1)
nop
lea    0xc99(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x1b0(%rsp,%r14,1),%esi
mov    0x1b4(%rsp,%r14,1),%edx
mov    0x1b8(%rsp,%r14,1),%ecx
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x1bc(%rsp,%r14,1),%esi
mov    0x1c0(%rsp,%r14,1),%edx
mov    0x1c4(%rsp,%r14,1),%ecx
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x1c8(%rsp,%r14,1),%esi
mov    0x1cc(%rsp,%r14,1),%edx
mov    0x1d0(%rsp,%r14,1),%ecx
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movsd  -0x10(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
movsd  0x0(%rbp),%xmm2
mov    %r12,%rdi
mov    $0x3,%al
call   1040 <printf@plt>
add    $0x18,%rbp
add    $0x24,%r14
add    $0x1,%ebx
cmp    %r14,%r13
jne    14c0 <test_spg_get_symmetry+0x380>
mov    0x8(%rsp),%rsp
add    $0xd78,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@__const.test_spg_get_symmetry.position = [12 x [3 x double]] [[3 x double] zeroinitializer, [3 x double] [double 5.000000e-01, double 5.000000e-01, double 2.500000e-01], [3 x double] [double 3.000000e-01, double 3.000000e-01, double 0.000000e+00], [3 x double] [double 0x3FE6666666666666, double 0x3FE6666666666666, double 0.000000e+00], [3 x double] [double 2.000000e-01, double 8.000000e-01, double 2.500000e-01], [3 x double] [double 8.000000e-01, double 2.000000e-01, double 2.500000e-01], [3 x double] [double 0.000000e+00, double 0.000000e+00, double 5.000000e-01], [3 x double] [double 5.000000e-01, double 5.000000e-01, double 7.500000e-01], [3 x double] [double 3.000000e-01, double 3.000000e-01, double 5.000000e-01], [3 x double] [double 0x3FE6666666666666, double 0x3FE6666666666666, double 5.000000e-01], [3 x double] [double 2.000000e-01, double 8.000000e-01, double 7.500000e-01], [3 x double] [double 8.000000e-01, double 2.000000e-01, double 7.500000e-01]]
@__const.test_spg_get_symmetry.types = [12 x i32] [i32 1, i32 1, i32 2, i32 2, i32 2, i32 2, i32 1, i32 1, i32 2, i32 2, i32 2, i32 2]
@__const.test_spg_get_symmetry.origin_shift = [3 x double] [double 1.000000e-01, double 1.000000e-01, double 0.000000e+00]
@.str = [62 x i8] c"*** Example of spg_get_symmetry (Rutile two unit cells) ***:\0A\00"
@.str.1 = [12 x i8] c"--- %d ---\0A\00"
@.str.2 = [13 x i8] c"%2d %2d %2d\0A\00"
@.str.3 = [10 x i8] c"%f %f %f\0A\00"
define void @test_spg_get_symmetry() {
%1 = alloca [3 x [3 x double]]
%2 = alloca [12 x [3 x double]]
%3 = alloca [12 x i32]
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i64
%11 = alloca i64
%12 = alloca [3 x double]
%13 = bitcast [3 x [3 x double]]* %1 to i8*
%14 = bitcast i8* %13 to [3 x [3 x double]]*
%15 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %14, i32 0, i32 0
%16 = getelementptr inbounds [3 x double], [3 x double]* %15, i32 0, i32 0
store double 4.000000e+00, double* %16
%17 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %14, i32 0, i32 1
%18 = getelementptr inbounds [3 x double], [3 x double]* %17, i32 0, i32 1
store double 4.000000e+00, double* %18
%19 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %14, i32 0, i32 2
%20 = getelementptr inbounds [3 x double], [3 x double]* %19, i32 0, i32 2
store double 3.000000e+00, double* %20
%21 = bitcast [12 x [3 x double]]* %2 to i8*
%22 = bitcast [12 x i32]* %3 to i8*
store i32 12, i32* %4
store i32 50, i32* %5
%23 = load i32, i32* %5
%24 = zext i32 %23 to i64
%25 = call i8* @llvm.stacksave()
store i8* %25, i8** %9
%26 = alloca [3 x [3 x i32]], i64 %24
store i64 %24, i64* %10
%27 = load i32, i32* %5
%28 = zext i32 %27 to i64
%29 = alloca [3 x double], i64 %28
store i64 %28, i64* %11
%30 = bitcast [3 x double]* %12 to i8*
store i32 0, i32* %6
br label %31
31: ; preds = %56, %0
%32 = load i32, i32* %6
%33 = load i32, i32* %4
%34 = icmp slt i32 %32, %33
br i1 %34, label %35, label %59
35: ; preds = %31
store i32 0, i32* %7
br label %36
36: ; preds = %52, %35
%37 = load i32, i32* %7
%38 = icmp slt i32 %37, 3
br i1 %38, label %39, label %55
39: ; preds = %36
%40 = load i32, i32* %7
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds [3 x double], [3 x double]* %12, i64 0, i64 %41
%43 = load double, double* %42
%44 = load i32, i32* %6
%45 = sext i32 %44 to i64
%46 = getelementptr inbounds [12 x [3 x double]], [12 x [3 x double]]* %2, i64 0, i64 %45
%47 = load i32, i32* %7
%48 = sext i32 %47 to i64
%49 = getelementptr inbounds [3 x double], [3 x double]* %46, i64 0, i64 %48
%50 = load double, double* %49
%51 = fadd double %50, %43
store double %51, double* %49
br label %52
52: ; preds = %39
%53 = load i32, i32* %7
%54 = add nsw i32 %53, 1
store i32 %54, i32* %7
br label %36
55: ; preds = %36
br label %56
56: ; preds = %55
%57 = load i32, i32* %6
%58 = add nsw i32 %57, 1
store i32 %58, i32* %6
br label %31
59: ; preds = %31
%60 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0))
%61 = bitcast [3 x [3 x i32]]* %26 to i32***
%62 = bitcast [3 x double]* %29 to double**
%63 = load i32, i32* %5
%64 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %1, i64 0, i64 0
%65 = bitcast [3 x double]* %64 to double**
%66 = getelementptr inbounds [12 x [3 x double]], [12 x [3 x double]]* %2, i64 0, i64 0
%67 = bitcast [3 x double]* %66 to double**
%68 = getelementptr inbounds [12 x i32], [12 x i32]* %3, i64 0, i64 0
%69 = load i32, i32* %4
%70 = call i32 @spg_get_symmetry(i32*** %61, double** %62, i32 %63, double** %65, double** %67, i32* %68, i32 %69, i32 0)
store i32 %70, i32* %8
store i32 0, i32* %6
br label %71
71: ; preds = %128, %59
%72 = load i32, i32* %6
%73 = load i32, i32* %8
%74 = icmp slt i32 %72, %73
br i1 %74, label %75, label %131
75: ; preds = %71
%76 = load i32, i32* %6
%77 = add nsw i32 %76, 1
%78 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 %77)
store i32 0, i32* %7
br label %79
79: ; preds = %108, %75
%80 = load i32, i32* %7
%81 = icmp slt i32 %80, 3
br i1 %81, label %82, label %111
82: ; preds = %79
%83 = load i32, i32* %6
%84 = sext i32 %83 to i64
%85 = getelementptr inbounds [3 x [3 x i32]], [3 x [3 x i32]]* %26, i64 %84
%86 = load i32, i32* %7
%87 = sext i32 %86 to i64
%88 = getelementptr inbounds [3 x [3 x i32]], [3 x [3 x i32]]* %85, i64 0, i64 %87
%89 = getelementptr inbounds [3 x i32], [3 x i32]* %88, i64 0, i64 0
%90 = load i32, i32* %89
%91 = load i32, i32* %6
%92 = sext i32 %91 to i64
%93 = getelementptr inbounds [3 x [3 x i32]], [3 x [3 x i32]]* %26, i64 %92
%94 = load i32, i32* %7
%95 = sext i32 %94 to i64
%96 = getelementptr inbounds [3 x [3 x i32]], [3 x [3 x i32]]* %93, i64 0, i64 %95
%97 = getelementptr inbounds [3 x i32], [3 x i32]* %96, i64 0, i64 1
%98 = load i32, i32* %97
%99 = load i32, i32* %6
%100 = sext i32 %99 to i64
%101 = getelementptr inbounds [3 x [3 x i32]], [3 x [3 x i32]]* %26, i64 %100
%102 = load i32, i32* %7
%103 = sext i32 %102 to i64
%104 = getelementptr inbounds [3 x [3 x i32]], [3 x [3 x i32]]* %101, i64 0, i64 %103
%105 = getelementptr inbounds [3 x i32], [3 x i32]* %104, i64 0, i64 2
%106 = load i32, i32* %105
%107 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i32 %90, i32 %98, i32 %106)
br label %108
108: ; preds = %82
%109 = load i32, i32* %7
%110 = add nsw i32 %109, 1
store i32 %110, i32* %7
br label %79
111: ; preds = %79
%112 = load i32, i32* %6
%113 = sext i32 %112 to i64
%114 = getelementptr inbounds [3 x double], [3 x double]* %29, i64 %113
%115 = getelementptr inbounds [3 x double], [3 x double]* %114, i64 0, i64 0
%116 = load double, double* %115
%117 = load i32, i32* %6
%118 = sext i32 %117 to i64
%119 = getelementptr inbounds [3 x double], [3 x double]* %29, i64 %118
%120 = getelementptr inbounds [3 x double], [3 x double]* %119, i64 0, i64 1
%121 = load double, double* %120
%122 = load i32, i32* %6
%123 = sext i32 %122 to i64
%124 = getelementptr inbounds [3 x double], [3 x double]* %29, i64 %123
%125 = getelementptr inbounds [3 x double], [3 x double]* %124, i64 0, i64 2
%126 = load double, double* %125
%127 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), double %116, double %121, double %126)
br label %128
128: ; preds = %111
%129 = load i32, i32* %6
%130 = add nsw i32 %129, 1
store i32 %130, i32* %6
br label %71
131: ; preds = %71
%132 = load i8*, i8** %9
ret void
}

LLVM IR (-O2):
@__const.test_spg_get_symmetry.position = [12 x [3 x double]] [[3 x double] zeroinitializer, [3 x double] [double 5.000000e-01, double 5.000000e-01, double 2.500000e-01], [3 x double] [double 3.000000e-01, double 3.000000e-01, double 0.000000e+00], [3 x double] [double 0x3FE6666666666666, double 0x3FE6666666666666, double 0.000000e+00], [3 x double] [double 2.000000e-01, double 8.000000e-01, double 2.500000e-01], [3 x double] [double 8.000000e-01, double 2.000000e-01, double 2.500000e-01], [3 x double] [double 0.000000e+00, double 0.000000e+00, double 5.000000e-01], [3 x double] [double 5.000000e-01, double 5.000000e-01, double 7.500000e-01], [3 x double] [double 3.000000e-01, double 3.000000e-01, double 5.000000e-01], [3 x double] [double 0x3FE6666666666666, double 0x3FE6666666666666, double 5.000000e-01], [3 x double] [double 2.000000e-01, double 8.000000e-01, double 7.500000e-01], [3 x double] [double 8.000000e-01, double 2.000000e-01, double 7.500000e-01]]
@__const.test_spg_get_symmetry.types = [12 x i32] [i32 1, i32 1, i32 2, i32 2, i32 2, i32 2, i32 1, i32 1, i32 2, i32 2, i32 2, i32 2]
@.str.1 = [12 x i8] c"--- %d ---\0A\00"
@.str.2 = [13 x i8] c"%2d %2d %2d\0A\00"
@.str.3 = [10 x i8] c"%f %f %f\0A\00"
@str = [61 x i8] c"*** Example of spg_get_symmetry (Rutile two unit cells) ***:\00"
define void @test_spg_get_symmetry() {
%1 = alloca [3 x [3 x double]]
%2 = alloca [12 x [3 x double]]
%3 = alloca [12 x i32]
%4 = bitcast [3 x [3 x double]]* %1 to i8*
%5 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %1, i64 0, i64 0, i64 0
store double 4.000000e+00, double* %5
%6 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %1, i64 0, i64 1, i64 1
store double 4.000000e+00, double* %6
%7 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %1, i64 0, i64 2, i64 2
store double 3.000000e+00, double* %7
%8 = bitcast [12 x [3 x double]]* %2 to i8*
%9 = bitcast [12 x i32]* %3 to i8*
%10 = tail call i8* @llvm.stacksave()
%11 = alloca [50 x [3 x [3 x i32]]]
%12 = alloca [50 x [3 x double]]
%13 = getelementptr inbounds [12 x [3 x double]], [12 x [3 x double]]* %2, i64 0, i64 0, i64 0
%14 = getelementptr inbounds [12 x [3 x double]], [12 x [3 x double]]* %2, i64 0, i64 1, i64 0
%15 = load double, double* %13
%16 = load double, double* %14
%17 = insertelement <2 x double> poison, double %15, i64 0
%18 = insertelement <2 x double> %17, double %16, i64 1
%19 = fadd <2 x double> %18, <double 1.000000e-01, double 1.000000e-01>
%20 = getelementptr inbounds [12 x [3 x double]], [12 x [3 x double]]* %2, i64 0, i64 0, i64 1
%21 = getelementptr inbounds [12 x [3 x double]], [12 x [3 x double]]* %2, i64 0, i64 1, i64 1
%22 = load double, double* %20
%23 = load double, double* %21
%24 = insertelement <2 x double> poison, double %22, i64 0
%25 = insertelement <2 x double> %24, double %23, i64 1
%26 = fadd <2 x double> %25, <double 1.000000e-01, double 1.000000e-01>
%27 = getelementptr inbounds [12 x [3 x double]], [12 x [3 x double]]* %2, i64 0, i64 0, i64 2
%28 = getelementptr inbounds [12 x [3 x double]], [12 x [3 x double]]* %2, i64 0, i64 1, i64 2
%29 = load double, double* %27
%30 = load double, double* %28
%31 = insertelement <2 x double> poison, double %29, i64 0
%32 = insertelement <2 x double> %31, double %30, i64 1
%33 = fadd <2 x double> %32, zeroinitializer
%34 = bitcast [12 x [3 x double]]* %2 to <6 x double>*
%35 = shufflevector <2 x double> %19, <2 x double> %26, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
%36 = shufflevector <2 x double> %33, <2 x double> poison, <4 x i32> <i32 0, i32 1, i32 undef, i32 undef>
%37 = shufflevector <4 x double> %35, <4 x double> %36, <6 x i32> <i32 0, i32 2, i32 4, i32 1, i32 3, i32 5>
store <6 x double> %37, <6 x double>* %34
%38 = getelementptr inbounds [12 x [3 x double]], [12 x [3 x double]]* %2, i64 0, i64 2, i64 0
%39 = getelementptr inbounds [12 x [3 x double]], [12 x [3 x double]]* %2, i64 0, i64 3, i64 0
%40 = load double, double* %38
%41 = load double, double* %39
%42 = insertelement <2 x double> poison, double %40, i64 0
%43 = insertelement <2 x double> %42, double %41, i64 1
%44 = fadd <2 x double> %43, <double 1.000000e-01, double 1.000000e-01>
%45 = getelementptr inbounds [12 x [3 x double]], [12 x [3 x double]]* %2, i64 0, i64 2, i64 1
%46 = getelementptr inbounds [12 x [3 x double]], [12 x [3 x double]]* %2, i64 0, i64 3, i64 1
%47 = load double, double* %45
%48 = load double, double* %46
%49 = insertelement <2 x double> poison, double %47, i64 0
%50 = insertelement <2 x double> %49, double %48, i64 1
%51 = fadd <2 x double> %50, <double 1.000000e-01, double 1.000000e-01>
%52 = getelementptr inbounds [12 x [3 x double]], [12 x [3 x double]]* %2, i64 0, i64 2, i64 2
%53 = getelementptr inbounds [12 x [3 x double]], [12 x [3 x double]]* %2, i64 0, i64 3, i64 2
%54 = load double, double* %52
%55 = load double, double* %53
%56 = insertelement <2 x double> poison, double %54, i64 0
%57 = insertelement <2 x double> %56, double %55, i64 1
%58 = fadd <2 x double> %57, zeroinitializer
%59 = getelementptr inbounds [12 x [3 x double]], [12 x [3 x double]]* %2, i64 0, i64 2, i64 0
%60 = bitcast double* %59 to <6 x double>*
%61 = shufflevector <2 x double> %44, <2 x double> %51, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
%62 = shufflevector <2 x double> %58, <2 x double> poison, <4 x i32> <i32 0, i32 1, i32 undef, i32 undef>
%63 = shufflevector <4 x double> %61, <4 x double> %62, <6 x i32> <i32 0, i32 2, i32 4, i32 1, i32 3, i32 5>
store <6 x double> %63, <6 x double>* %60
%64 = getelementptr inbounds [12 x [3 x double]], [12 x [3 x double]]* %2, i64 0, i64 4, i64 0
%65 = getelementptr inbounds [12 x [3 x double]], [12 x [3 x double]]* %2, i64 0, i64 5, i64 0
%66 = load double, double* %64
%67 = load double, double* %65
%68 = insertelement <2 x double> poison, double %66, i64 0
%69 = insertelement <2 x double> %68, double %67, i64 1
%70 = fadd <2 x double> %69, <double 1.000000e-01, double 1.000000e-01>
%71 = getelementptr inbounds [12 x [3 x double]], [12 x [3 x double]]* %2, i64 0, i64 4, i64 1
%72 = getelementptr inbounds [12 x [3 x double]], [12 x [3 x double]]* %2, i64 0, i64 5, i64 1
%73 = load double, double* %71
%74 = load double, double* %72
%75 = insertelement <2 x double> poison, double %73, i64 0
%76 = insertelement <2 x double> %75, double %74, i64 1
%77 = fadd <2 x double> %76, <double 1.000000e-01, double 1.000000e-01>
%78 = getelementptr inbounds [12 x [3 x double]], [12 x [3 x double]]* %2, i64 0, i64 4, i64 2
%79 = getelementptr inbounds [12 x [3 x double]], [12 x [3 x double]]* %2, i64 0, i64 5, i64 2
%80 = load double, double* %78
%81 = load double, double* %79
%82 = insertelement <2 x double> poison, double %80, i64 0
%83 = insertelement <2 x double> %82, double %81, i64 1
%84 = fadd <2 x double> %83, zeroinitializer
%85 = getelementptr inbounds [12 x [3 x double]], [12 x [3 x double]]* %2, i64 0, i64 4, i64 0
%86 = bitcast double* %85 to <6 x double>*
%87 = shufflevector <2 x double> %70, <2 x double> %77, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
%88 = shufflevector <2 x double> %84, <2 x double> poison, <4 x i32> <i32 0, i32 1, i32 undef, i32 undef>
%89 = shufflevector <4 x double> %87, <4 x double> %88, <6 x i32> <i32 0, i32 2, i32 4, i32 1, i32 3, i32 5>
store <6 x double> %89, <6 x double>* %86
%90 = getelementptr inbounds [12 x [3 x double]], [12 x [3 x double]]* %2, i64 0, i64 6, i64 0
%91 = getelementptr inbounds [12 x [3 x double]], [12 x [3 x double]]* %2, i64 0, i64 7, i64 0
%92 = load double, double* %90
%93 = load double, double* %91
%94 = insertelement <2 x double> poison, double %92, i64 0
%95 = insertelement <2 x double> %94, double %93, i64 1
%96 = fadd <2 x double> %95, <double 1.000000e-01, double 1.000000e-01>
%97 = getelementptr inbounds [12 x [3 x double]], [12 x [3 x double]]* %2, i64 0, i64 6, i64 1
%98 = getelementptr inbounds [12 x [3 x double]], [12 x [3 x double]]* %2, i64 0, i64 7, i64 1
%99 = load double, double* %97
%100 = load double, double* %98
%101 = insertelement <2 x double> poison, double %99, i64 0
%102 = insertelement <2 x double> %101, double %100, i64 1
%103 = fadd <2 x double> %102, <double 1.000000e-01, double 1.000000e-01>
%104 = getelementptr inbounds [12 x [3 x double]], [12 x [3 x double]]* %2, i64 0, i64 6, i64 2
%105 = getelementptr inbounds [12 x [3 x double]], [12 x [3 x double]]* %2, i64 0, i64 7, i64 2
%106 = load double, double* %104
%107 = load double, double* %105
%108 = insertelement <2 x double> poison, double %106, i64 0
%109 = insertelement <2 x double> %108, double %107, i64 1
%110 = fadd <2 x double> %109, zeroinitializer
%111 = getelementptr inbounds [12 x [3 x double]], [12 x [3 x double]]* %2, i64 0, i64 6, i64 0
%112 = bitcast double* %111 to <6 x double>*
%113 = shufflevector <2 x double> %96, <2 x double> %103, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
%114 = shufflevector <2 x double> %110, <2 x double> poison, <4 x i32> <i32 0, i32 1, i32 undef, i32 undef>
%115 = shufflevector <4 x double> %113, <4 x double> %114, <6 x i32> <i32 0, i32 2, i32 4, i32 1, i32 3, i32 5>
store <6 x double> %115, <6 x double>* %112
%116 = getelementptr inbounds [12 x [3 x double]], [12 x [3 x double]]* %2, i64 0, i64 8, i64 0
%117 = getelementptr inbounds [12 x [3 x double]], [12 x [3 x double]]* %2, i64 0, i64 9, i64 0
%118 = load double, double* %116
%119 = load double, double* %117
%120 = insertelement <2 x double> poison, double %118, i64 0
%121 = insertelement <2 x double> %120, double %119, i64 1
%122 = fadd <2 x double> %121, <double 1.000000e-01, double 1.000000e-01>
%123 = getelementptr inbounds [12 x [3 x double]], [12 x [3 x double]]* %2, i64 0, i64 8, i64 1
%124 = getelementptr inbounds [12 x [3 x double]], [12 x [3 x double]]* %2, i64 0, i64 9, i64 1
%125 = load double, double* %123
%126 = load double, double* %124
%127 = insertelement <2 x double> poison, double %125, i64 0
%128 = insertelement <2 x double> %127, double %126, i64 1
%129 = fadd <2 x double> %128, <double 1.000000e-01, double 1.000000e-01>
%130 = getelementptr inbounds [12 x [3 x double]], [12 x [3 x double]]* %2, i64 0, i64 8, i64 2
%131 = getelementptr inbounds [12 x [3 x double]], [12 x [3 x double]]* %2, i64 0, i64 9, i64 2
%132 = load double, double* %130
%133 = load double, double* %131
%134 = insertelement <2 x double> poison, double %132, i64 0
%135 = insertelement <2 x double> %134, double %133, i64 1
%136 = fadd <2 x double> %135, zeroinitializer
%137 = getelementptr inbounds [12 x [3 x double]], [12 x [3 x double]]* %2, i64 0, i64 8, i64 0
%138 = bitcast double* %137 to <6 x double>*
%139 = shufflevector <2 x double> %122, <2 x double> %129, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
%140 = shufflevector <2 x double> %136, <2 x double> poison, <4 x i32> <i32 0, i32 1, i32 undef, i32 undef>
%141 = shufflevector <4 x double> %139, <4 x double> %140, <6 x i32> <i32 0, i32 2, i32 4, i32 1, i32 3, i32 5>
store <6 x double> %141, <6 x double>* %138
%142 = getelementptr inbounds [12 x [3 x double]], [12 x [3 x double]]* %2, i64 0, i64 10, i64 0
%143 = getelementptr inbounds [12 x [3 x double]], [12 x [3 x double]]* %2, i64 0, i64 11, i64 0
%144 = load double, double* %142
%145 = load double, double* %143
%146 = insertelement <2 x double> poison, double %144, i64 0
%147 = insertelement <2 x double> %146, double %145, i64 1
%148 = fadd <2 x double> %147, <double 1.000000e-01, double 1.000000e-01>
%149 = getelementptr inbounds [12 x [3 x double]], [12 x [3 x double]]* %2, i64 0, i64 10, i64 1
%150 = getelementptr inbounds [12 x [3 x double]], [12 x [3 x double]]* %2, i64 0, i64 11, i64 1
%151 = load double, double* %149
%152 = load double, double* %150
%153 = insertelement <2 x double> poison, double %151, i64 0
%154 = insertelement <2 x double> %153, double %152, i64 1
%155 = fadd <2 x double> %154, <double 1.000000e-01, double 1.000000e-01>
%156 = getelementptr inbounds [12 x [3 x double]], [12 x [3 x double]]* %2, i64 0, i64 10, i64 2
%157 = getelementptr inbounds [12 x [3 x double]], [12 x [3 x double]]* %2, i64 0, i64 11, i64 2
%158 = load double, double* %156
%159 = load double, double* %157
%160 = insertelement <2 x double> poison, double %158, i64 0
%161 = insertelement <2 x double> %160, double %159, i64 1
%162 = fadd <2 x double> %161, zeroinitializer
%163 = getelementptr inbounds [12 x [3 x double]], [12 x [3 x double]]* %2, i64 0, i64 10, i64 0
%164 = bitcast double* %163 to <6 x double>*
%165 = shufflevector <2 x double> %148, <2 x double> %155, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
%166 = shufflevector <2 x double> %162, <2 x double> poison, <4 x i32> <i32 0, i32 1, i32 undef, i32 undef>
%167 = shufflevector <4 x double> %165, <4 x double> %166, <6 x i32> <i32 0, i32 2, i32 4, i32 1, i32 3, i32 5>
store <6 x double> %167, <6 x double>* %164
%168 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([61 x i8], [61 x i8]* @str, i64 0, i64 0))
%169 = bitcast [50 x [3 x [3 x i32]]]* %11 to i32***
%170 = bitcast [50 x [3 x double]]* %12 to double**
%171 = bitcast [3 x [3 x double]]* %1 to double**
%172 = bitcast [12 x [3 x double]]* %2 to double**
%173 = getelementptr inbounds [12 x i32], [12 x i32]* %3, i64 0, i64 0
%174 = call i32 @spg_get_symmetry(i32*** %169, double** %170, i32 50, double** %171, double** %172, i32* %173, i32 12, i32 0)
%175 = icmp sgt i32 %174, 0
br i1 %175, label %176, label %212
176: ; preds = %0
%177 = zext i32 %174 to i64
br label %178
178: ; preds = %176, %178
%179 = phi i64 [ 0, %176 ], [ %180, %178 ]
%180 = add nuw nsw i64 %179, 1
%181 = trunc i64 %180 to i32
%182 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 %181)
%183 = getelementptr inbounds [50 x [3 x [3 x i32]]], [50 x [3 x [3 x i32]]]* %11, i64 0, i64 %179, i64 0, i64 0
%184 = load i32, i32* %183
%185 = getelementptr inbounds [50 x [3 x [3 x i32]]], [50 x [3 x [3 x i32]]]* %11, i64 0, i64 %179, i64 0, i64 1
%186 = load i32, i32* %185
%187 = getelementptr inbounds [50 x [3 x [3 x i32]]], [50 x [3 x [3 x i32]]]* %11, i64 0, i64 %179, i64 0, i64 2
%188 = load i32, i32* %187
%189 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i32 %184, i32 %186, i32 %188)
%190 = getelementptr inbounds [50 x [3 x [3 x i32]]], [50 x [3 x [3 x i32]]]* %11, i64 0, i64 %179, i64 1, i64 0
%191 = load i32, i32* %190
%192 = getelementptr inbounds [50 x [3 x [3 x i32]]], [50 x [3 x [3 x i32]]]* %11, i64 0, i64 %179, i64 1, i64 1
%193 = load i32, i32* %192
%194 = getelementptr inbounds [50 x [3 x [3 x i32]]], [50 x [3 x [3 x i32]]]* %11, i64 0, i64 %179, i64 1, i64 2
%195 = load i32, i32* %194
%196 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i32 %191, i32 %193, i32 %195)
%197 = getelementptr inbounds [50 x [3 x [3 x i32]]], [50 x [3 x [3 x i32]]]* %11, i64 0, i64 %179, i64 2, i64 0
%198 = load i32, i32* %197
%199 = getelementptr inbounds [50 x [3 x [3 x i32]]], [50 x [3 x [3 x i32]]]* %11, i64 0, i64 %179, i64 2, i64 1
%200 = load i32, i32* %199
%201 = getelementptr inbounds [50 x [3 x [3 x i32]]], [50 x [3 x [3 x i32]]]* %11, i64 0, i64 %179, i64 2, i64 2
%202 = load i32, i32* %201
%203 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i32 %198, i32 %200, i32 %202)
%204 = getelementptr inbounds [50 x [3 x double]], [50 x [3 x double]]* %12, i64 0, i64 %179, i64 0
%205 = load double, double* %204
%206 = getelementptr inbounds [50 x [3 x double]], [50 x [3 x double]]* %12, i64 0, i64 %179, i64 1
%207 = load double, double* %206
%208 = getelementptr inbounds [50 x [3 x double]], [50 x [3 x double]]* %12, i64 0, i64 %179, i64 2
%209 = load double, double* %208
%210 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), double %205, double %207, double %209)
%211 = icmp eq i64 %180, %177
br i1 %211, label %212, label %178
212: ; preds = %178, %0
ret void
}