#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 /*<<< orphan*/ show_spg_dataset(double **, double *, double **, int, int *);
void test_spg_get_dataset(void) {
  printf("*** Example of spg_get_dataset (Rutile two unit cells) ***:\n");
  double lattice[3][3] = {{4, 0, 0}, {0, 4, 0}, {0, 0, 3}};
  double origin_shift[3] = {0.1, 0.1, 0};
  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;
  show_spg_dataset(lattice, origin_shift, position, num_atom, types);
  double lattice_2[3][3] = {{3.7332982433264039, -1.8666491216632011, 0},
                            {0, 3.2331311186244847, 0},
                            {0, 0, 6.0979971306362799}};
  double origin_shift_2[3] = {0.1, 0.1, 0};
  double position_2[][3] = {
      {0, 0, 0},
      {1.0 / 3, 2.0 / 3, 0.4126},
      {1.0 / 3, 2.0 / 3, 0.776},
      {2.0 / 3, 1.0 / 3, 0.2542},
  };
  int types_2[] = {1, 2, 3, 3};
  int num_atom_2 = 4;
  show_spg_dataset(lattice_2, origin_shift_2, position_2, num_atom_2, types_2);
}


x86 assembly (clang, -O0):
<test_spg_get_dataset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x2b0,%rsp
lea    0xede(%rip),%rdi
call   1040 <printf@plt>
lea    -0x50(%rbp),%rdi
xor    %esi,%esi
mov    $0x48,%edx
call   1050 <memset@plt>
movsd  0xeb9(%rip),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  0xeac(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  0xe97(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    0xedb(%rip),%rax
mov    %rax,-0x70(%rbp)
mov    0xed8(%rip),%rax
mov    %rax,-0x68(%rbp)
mov    0xed5(%rip),%rax
mov    %rax,-0x60(%rbp)
lea    -0x190(%rbp),%rdi
lea    0xed3(%rip),%rsi
mov    $0x120,%edx
call   1060 <memcpy@plt>
lea    -0x1c0(%rbp),%rdi
lea    0xfdb(%rip),%rsi
mov    $0x30,%edx
call   1060 <memcpy@plt>
movl   $0xc,-0x1c4(%rbp)
lea    -0x50(%rbp),%rdi
lea    -0x70(%rbp),%rsi
lea    -0x190(%rbp),%rdx
mov    -0x1c4(%rbp),%ecx
lea    -0x1c0(%rbp),%r8
call   1030 <show_spg_dataset@plt>
lea    -0x210(%rbp),%rdi
xor    %esi,%esi
mov    $0x48,%edx
call   1050 <memset@plt>
movsd  0xdf3(%rip),%xmm0
movsd  %xmm0,-0x210(%rbp)
ff
movsd  0xddb(%rip),%xmm0
movsd  %xmm0,-0x208(%rbp)
ff
movsd  0xdc3(%rip),%xmm0
movsd  %xmm0,-0x1f0(%rbp)
ff
movsd  0xdab(%rip),%xmm0
movsd  %xmm0,-0x1d0(%rbp)
ff
mov    0xf7c(%rip),%rax
mov    %rax,-0x230(%rbp)
mov    0xf76(%rip),%rax
mov    %rax,-0x228(%rbp)
mov    0xf70(%rip),%rax
mov    %rax,-0x220(%rbp)
lea    -0x290(%rbp),%rdi
lea    0xf6b(%rip),%rsi
mov    $0x60,%edx
call   1060 <memcpy@plt>
mov    0xfba(%rip),%rax
mov    %rax,-0x2a0(%rbp)
mov    0xfb4(%rip),%rax
mov    %rax,-0x298(%rbp)
movl   $0x4,-0x2a4(%rbp)
lea    -0x210(%rbp),%rdi
lea    -0x230(%rbp),%rsi
lea    -0x290(%rbp),%rdx
mov    -0x2a4(%rbp),%ecx
lea    -0x2a0(%rbp),%r8
call   1030 <show_spg_dataset@plt>
add    $0x2b0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_spg_get_dataset>:
push   %r14
push   %rbx
sub    $0x2a8,%rsp
lea    0x10af(%rip),%rdi
call   1040 <puts@plt>
xorps  %xmm0,%xmm0
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x80(%rsp)
movaps %xmm0,0x60(%rsp)
movabs $0x4010000000000000,%rax
mov    %rax,0x50(%rsp)
mov    %rax,0x70(%rsp)
movabs $0x4008000000000000,%rax
mov    %rax,0x90(%rsp)
mov    0xff3(%rip),%r14
mov    %r14,0x40(%rsp)
movaps 0xfd7(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
lea    0xe7b(%rip),%rsi
lea    0x180(%rsp),%rbx
mov    $0x120,%edx
mov    %rbx,%rdi
call   1050 <memcpy@plt>
movaps 0xf9f(%rip),%xmm0
movaps %xmm0,0x110(%rsp)
movaps 0xf80(%rip),%xmm0
movaps %xmm0,0x100(%rsp)
movaps 0xf61(%rip),%xmm0
movaps %xmm0,0xf0(%rsp)
lea    0x50(%rsp),%rdi
lea    0x30(%rsp),%rsi
lea    0xf0(%rsp),%r8
mov    %rbx,%rdx
mov    $0xc,%ecx
call   1030 <show_spg_dataset@plt>
xorps  %xmm0,%xmm0
movaps %xmm0,0xc0(%rsp)
movaps %xmm0,0xd0(%rsp)
movaps %xmm0,0xb0(%rsp)
movaps 0xdd8(%rip),%xmm0
movaps %xmm0,0xa0(%rsp)
movabs $0x4009dd73d9116060,%rax
dd 09 40
mov    %rax,0xc0(%rsp)
movabs $0x401864595c1cbd18,%rax
64 18 40
mov    %rax,0xe0(%rsp)
mov    %r14,0x20(%rsp)
movaps 0xf10(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xf74(%rip),%xmm0
movaps %xmm0,0x170(%rsp)
movaps 0xf55(%rip),%xmm0
movaps %xmm0,0x160(%rsp)
movaps 0xf36(%rip),%xmm0
movaps %xmm0,0x150(%rsp)
movaps 0xf17(%rip),%xmm0
movaps %xmm0,0x140(%rsp)
movaps 0xef8(%rip),%xmm0
movaps %xmm0,0x130(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,0x120(%rsp)
movaps 0xd4a(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0xa0(%rsp),%rdi
lea    0x10(%rsp),%rsi
lea    0x120(%rsp),%rdx
mov    %rsp,%r8
mov    $0x4,%ecx
call   1030 <show_spg_dataset@plt>
add    $0x2a8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [61 x i8] c"*** Example of spg_get_dataset (Rutile two unit cells) ***:\0A\00"
@__const.test_spg_get_dataset.origin_shift = [3 x double] [double 1.000000e-01, double 1.000000e-01, double 0.000000e+00]
@__const.test_spg_get_dataset.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_dataset.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_dataset.origin_shift_2 = [3 x double] [double 1.000000e-01, double 1.000000e-01, double 0.000000e+00]
@__const.test_spg_get_dataset.position_2 = [4 x [3 x double]] [[3 x double] zeroinitializer, [3 x double] [double 0x3FD5555555555555, double 0x3FE5555555555555, double 4.126000e-01], [3 x double] [double 0x3FD5555555555555, double 0x3FE5555555555555, double 7.760000e-01], [3 x double] [double 0x3FE5555555555555, double 0x3FD5555555555555, double 2.542000e-01]]
@__const.test_spg_get_dataset.types_2 = [4 x i32] [i32 1, i32 2, i32 3, i32 3]
define void @test_spg_get_dataset() {
%1 = alloca [3 x [3 x double]]
%2 = alloca [3 x double]
%3 = alloca [12 x [3 x double]]
%4 = alloca [12 x i32]
%5 = alloca i32
%6 = alloca [3 x [3 x double]]
%7 = alloca [3 x double]
%8 = alloca [4 x [3 x double]]
%9 = alloca [4 x i32]
%10 = alloca i32
%11 = call i32 @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0))
%12 = bitcast [3 x [3 x double]]* %1 to i8*
%13 = bitcast i8* %12 to [3 x [3 x double]]*
%14 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %13, i32 0, i32 0
%15 = getelementptr inbounds [3 x double], [3 x double]* %14, i32 0, i32 0
store double 4.000000e+00, double* %15
%16 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %13, i32 0, i32 1
%17 = getelementptr inbounds [3 x double], [3 x double]* %16, i32 0, i32 1
store double 4.000000e+00, double* %17
%18 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %13, i32 0, i32 2
%19 = getelementptr inbounds [3 x double], [3 x double]* %18, i32 0, i32 2
store double 3.000000e+00, double* %19
%20 = bitcast [3 x double]* %2 to i8*
%21 = bitcast [12 x [3 x double]]* %3 to i8*
%22 = bitcast [12 x i32]* %4 to i8*
store i32 12, i32* %5
%23 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %1, i64 0, i64 0
%24 = bitcast [3 x double]* %23 to double**
%25 = getelementptr inbounds [3 x double], [3 x double]* %2, i64 0, i64 0
%26 = getelementptr inbounds [12 x [3 x double]], [12 x [3 x double]]* %3, i64 0, i64 0
%27 = bitcast [3 x double]* %26 to double**
%28 = load i32, i32* %5
%29 = getelementptr inbounds [12 x i32], [12 x i32]* %4, i64 0, i64 0
%30 = call i32 @show_spg_dataset(double** %24, double* %25, double** %27, i32 %28, i32* %29)
%31 = bitcast [3 x [3 x double]]* %6 to i8*
%32 = bitcast i8* %31 to [3 x [3 x double]]*
%33 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %32, i32 0, i32 0
%34 = getelementptr inbounds [3 x double], [3 x double]* %33, i32 0, i32 0
store double 0x400DDDCB782A68C4, double* %34
%35 = getelementptr inbounds [3 x double], [3 x double]* %33, i32 0, i32 1
store double 0xBFFDDDCB782A68C0, double* %35
%36 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %32, i32 0, i32 1
%37 = getelementptr inbounds [3 x double], [3 x double]* %36, i32 0, i32 1
store double 0x4009DD73D9116060, double* %37
%38 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %32, i32 0, i32 2
%39 = getelementptr inbounds [3 x double], [3 x double]* %38, i32 0, i32 2
store double 0x401864595C1CBD18, double* %39
%40 = bitcast [3 x double]* %7 to i8*
%41 = bitcast [4 x [3 x double]]* %8 to i8*
%42 = bitcast [4 x i32]* %9 to i8*
store i32 4, i32* %10
%43 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %6, i64 0, i64 0
%44 = bitcast [3 x double]* %43 to double**
%45 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 0
%46 = getelementptr inbounds [4 x [3 x double]], [4 x [3 x double]]* %8, i64 0, i64 0
%47 = bitcast [3 x double]* %46 to double**
%48 = load i32, i32* %10
%49 = getelementptr inbounds [4 x i32], [4 x i32]* %9, i64 0, i64 0
%50 = call i32 @show_spg_dataset(double** %44, double* %45, double** %47, i32 %48, i32* %49)
ret void
}

LLVM IR (-O2):
@__const.test_spg_get_dataset.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_dataset.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_dataset.origin_shift_2 = [3 x double] [double 1.000000e-01, double 1.000000e-01, double 0.000000e+00]
@__const.test_spg_get_dataset.position_2 = [4 x [3 x double]] [[3 x double] zeroinitializer, [3 x double] [double 0x3FD5555555555555, double 0x3FE5555555555555, double 4.126000e-01], [3 x double] [double 0x3FD5555555555555, double 0x3FE5555555555555, double 7.760000e-01], [3 x double] [double 0x3FE5555555555555, double 0x3FD5555555555555, double 2.542000e-01]]
@__const.test_spg_get_dataset.types_2 = [4 x i32] [i32 1, i32 2, i32 3, i32 3]
@str = [60 x i8] c"*** Example of spg_get_dataset (Rutile two unit cells) ***:\00"
define void @test_spg_get_dataset() {
%1 = alloca [3 x [3 x double]]
%2 = alloca [3 x double]
%3 = alloca [12 x [3 x double]]
%4 = alloca [12 x i32]
%5 = alloca [3 x [3 x double]]
%6 = alloca [3 x double]
%7 = alloca [4 x [3 x double]]
%8 = alloca [4 x i32]
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @str, i64 0, i64 0))
%10 = bitcast [3 x [3 x double]]* %1 to i8*
%11 = 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* %11
%12 = 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* %12
%13 = 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* %13
%14 = bitcast [3 x double]* %2 to i8*
%15 = bitcast [12 x [3 x double]]* %3 to i8*
%16 = bitcast [12 x i32]* %4 to i8*
%17 = bitcast [3 x [3 x double]]* %1 to double**
%18 = getelementptr inbounds [3 x double], [3 x double]* %2, i64 0, i64 0
%19 = bitcast [12 x [3 x double]]* %3 to double**
%20 = getelementptr inbounds [12 x i32], [12 x i32]* %4, i64 0, i64 0
%21 = call i32 @show_spg_dataset(double** %17, double* %18, double** %19, i32 12, i32* %20)
%22 = bitcast [3 x [3 x double]]* %5 to i8*
%23 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %5, i64 0, i64 0, i64 2
%24 = bitcast double* %23 to i8*
%25 = bitcast [3 x [3 x double]]* %5 to <2 x double>*
store <2 x double> <double 0x400DDDCB782A68C4, double 0xBFFDDDCB782A68C0>, <2 x double>* %25
%26 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %5, i64 0, i64 1, i64 1
store double 0x4009DD73D9116060, double* %26
%27 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %5, i64 0, i64 2, i64 2
store double 0x401864595C1CBD18, double* %27
%28 = bitcast [3 x double]* %6 to i8*
%29 = bitcast [4 x [3 x double]]* %7 to i8*
%30 = bitcast [4 x i32]* %8 to i8*
%31 = bitcast [3 x [3 x double]]* %5 to double**
%32 = getelementptr inbounds [3 x double], [3 x double]* %6, i64 0, i64 0
%33 = bitcast [4 x [3 x double]]* %7 to double**
%34 = getelementptr inbounds [4 x i32], [4 x i32]* %8, i64 0, i64 0
%35 = call i32 @show_spg_dataset(double** %31, double* %32, double** %33, i32 4, i32* %34)
ret void
}