#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*/ sub_spg_standardize_cell(double **, double **, int *, int,
                                            double, int, int);
void test_spg_standardize_cell_BCC(void) {
  double lattice[3][3] = {{3.97, 0, 0}, {0, 4.03, 0}, {0, 0, 4.0}};
  double position[][3] = {{0.002, 0, 0}, {0.5, 0.5001, 0.5}};
  int types[] = {1, 1};
  int i, j, k, num_atom = 2, num_primitive_atom;
  double symprec = 1e-1;
  printf("*** Example of spg_standardize_cell (BCC unitcell) ***:\n");
  printf("------------------------------------------------------\n");
  for (j = 0; j < 2; j++) {
    for (k = 0; k < 2; k++) {
      sub_spg_standardize_cell(lattice, position, types, num_atom, symprec, j,
                               k);
      printf("------------------------------------------------------\n");
    }
  }
}


x86 assembly (clang, -O0):
<test_spg_standardize_cell_BCC>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
lea    -0x50(%rbp),%rdi
xor    %esi,%esi
mov    $0x48,%edx
call   1040 <memset@plt>
movsd  0xedd(%rip),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  0xec8(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  0xeb3(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
lea    -0x80(%rbp),%rdi
xor    %esi,%esi
mov    $0x30,%edx
call   1040 <memset@plt>
movsd  0xe8e(%rip),%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  0xe71(%rip),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  0xe6c(%rip),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  0xe57(%rip),%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    0xe7b(%rip),%rax
mov    %rax,-0x88(%rbp)
movl   $0x2,-0x98(%rbp)
movsd  0xe2a(%rip),%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
lea    0xe5b(%rip),%rdi
call   1030 <printf@plt>
lea    0xe88(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x90(%rbp)
cmpl   $0x2,-0x90(%rbp)
jge    128d <test_spg_standardize_cell_BCC+0x15d>
movl   $0x0,-0x94(%rbp)
cmpl   $0x2,-0x94(%rbp)
jge    1274 <test_spg_standardize_cell_BCC+0x144>
lea    -0x50(%rbp),%rdi
lea    -0x80(%rbp),%rsi
lea    -0x88(%rbp),%rdx
mov    -0x98(%rbp),%ecx
movsd  -0xa8(%rbp),%xmm0
ff
mov    -0x90(%rbp),%r8d
mov    -0x94(%rbp),%r9d
call   1050 <sub_spg_standardize_cell@plt>
lea    0xe1e(%rip),%rdi
call   1030 <printf@plt>
mov    -0x94(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x94(%rbp)
jmp    1217 <test_spg_standardize_cell_BCC+0xe7>
jmp    1279 <test_spg_standardize_cell_BCC+0x149>
mov    -0x90(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x90(%rbp)
jmp    1200 <test_spg_standardize_cell_BCC+0xd0>
add    $0xb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_spg_standardize_cell_BCC>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x88,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x50(%rsp)
movabs $0x400fc28f5c28f5c3,%rax
c2 0f 40
mov    %rax,0x40(%rsp)
movabs $0x40101eb851eb851f,%rax
1e 10 40
mov    %rax,0x60(%rsp)
movabs $0x4010000000000000,%rax
mov    %rax,0x80(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,0x20(%rsp)
movabs $0x3f60624dd2f1a9fc,%rax
62 60 3f
mov    %rax,0x10(%rsp)
movaps 0xe6b(%rip),%xmm0
movups %xmm0,0x28(%rsp)
movabs $0x3fe0000000000000,%rax
mov    %rax,0x38(%rsp)
movabs $0x100000001,%rax
mov    %rax,0x8(%rsp)
lea    0xe59(%rip),%rdi
call   1030 <puts@plt>
lea    0xe85(%rip),%r14
mov    %r14,%rdi
call   1030 <puts@plt>
lea    0x40(%rsp),%rbx
lea    0x10(%rsp),%r15
lea    0x8(%rsp),%r12
movsd  0xe26(%rip),%xmm0
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r12,%rdx
mov    $0x2,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1040 <sub_spg_standardize_cell@plt>
mov    %r14,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r12,%rdx
mov    $0x2,%ecx
movsd  0xdef(%rip),%xmm0
xor    %r8d,%r8d
mov    $0x1,%r9d
call   1040 <sub_spg_standardize_cell@plt>
mov    %r14,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r12,%rdx
mov    $0x2,%ecx
movsd  0xdc3(%rip),%xmm0
mov    $0x1,%r8d
xor    %r9d,%r9d
call   1040 <sub_spg_standardize_cell@plt>
mov    %r14,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r12,%rdx
mov    $0x2,%ecx
movsd  0xd97(%rip),%xmm0
mov    $0x1,%r8d
mov    $0x1,%r9d
call   1040 <sub_spg_standardize_cell@plt>
mov    %r14,%rdi
call   1030 <puts@plt>
add    $0x88,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@__const.test_spg_standardize_cell_BCC.types = [2 x i32] [i32 1, i32 1]
@.str = [57 x i8] c"*** Example of spg_standardize_cell (BCC unitcell) ***:\0A\00"
@.str.1 = [56 x i8] c"------------------------------------------------------\0A\00"
define void @test_spg_standardize_cell_BCC() {
%1 = alloca [3 x [3 x double]]
%2 = alloca [2 x [3 x double]]
%3 = alloca [2 x i32]
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca double
%10 = bitcast [3 x [3 x double]]* %1 to i8*
%11 = bitcast i8* %10 to [3 x [3 x double]]*
%12 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %11, i32 0, i32 0
%13 = getelementptr inbounds [3 x double], [3 x double]* %12, i32 0, i32 0
store double 3.970000e+00, double* %13
%14 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %11, i32 0, i32 1
%15 = getelementptr inbounds [3 x double], [3 x double]* %14, i32 0, i32 1
store double 4.030000e+00, double* %15
%16 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %11, i32 0, i32 2
%17 = getelementptr inbounds [3 x double], [3 x double]* %16, i32 0, i32 2
store double 4.000000e+00, double* %17
%18 = bitcast [2 x [3 x double]]* %2 to i8*
%19 = bitcast i8* %18 to [2 x [3 x double]]*
%20 = getelementptr inbounds [2 x [3 x double]], [2 x [3 x double]]* %19, i32 0, i32 0
%21 = getelementptr inbounds [3 x double], [3 x double]* %20, i32 0, i32 0
store double 2.000000e-03, double* %21
%22 = getelementptr inbounds [2 x [3 x double]], [2 x [3 x double]]* %19, i32 0, i32 1
%23 = getelementptr inbounds [3 x double], [3 x double]* %22, i32 0, i32 0
store double 5.000000e-01, double* %23
%24 = getelementptr inbounds [3 x double], [3 x double]* %22, i32 0, i32 1
store double 5.001000e-01, double* %24
%25 = getelementptr inbounds [3 x double], [3 x double]* %22, i32 0, i32 2
store double 5.000000e-01, double* %25
%26 = bitcast [2 x i32]* %3 to i8*
store i32 2, i32* %7
store double 1.000000e-01, double* %9
%27 = call i32 @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0))
%28 = call i32 @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %5
br label %29
29: ; preds = %52, %0
%30 = load i32, i32* %5
%31 = icmp slt i32 %30, 2
br i1 %31, label %32, label %55
32: ; preds = %29
store i32 0, i32* %6
br label %33
33: ; preds = %48, %32
%34 = load i32, i32* %6
%35 = icmp slt i32 %34, 2
br i1 %35, label %36, label %51
36: ; preds = %33
%37 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %1, i64 0, i64 0
%38 = bitcast [3 x double]* %37 to double**
%39 = getelementptr inbounds [2 x [3 x double]], [2 x [3 x double]]* %2, i64 0, i64 0
%40 = bitcast [3 x double]* %39 to double**
%41 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 0
%42 = load i32, i32* %7
%43 = load double, double* %9
%44 = load i32, i32* %5
%45 = load i32, i32* %6
%46 = call i32 @sub_spg_standardize_cell(double** %38, double** %40, i32* %41, i32 %42, double %43, i32 %44, i32 %45)
%47 = call i32 @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.1, i64 0, i64 0))
br label %48
48: ; preds = %36
%49 = load i32, i32* %6
%50 = add nsw i32 %49, 1
store i32 %50, i32* %6
br label %33
51: ; preds = %33
br label %52
52: ; preds = %51
%53 = load i32, i32* %5
%54 = add nsw i32 %53, 1
store i32 %54, i32* %5
br label %29
55: ; preds = %29
ret void
}

LLVM IR (-O2):
@str = [56 x i8] c"*** Example of spg_standardize_cell (BCC unitcell) ***:\00"
@str.3 = [55 x i8] c"------------------------------------------------------\00"
define void @test_spg_standardize_cell_BCC() {
%1 = alloca [3 x [3 x double]]
%2 = alloca [2 x [3 x double]]
%3 = alloca i64
%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 3.970000e+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.030000e+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 4.000000e+00, double* %7
%8 = bitcast [2 x [3 x double]]* %2 to i8*
%9 = getelementptr inbounds [2 x [3 x double]], [2 x [3 x double]]* %2, i64 0, i64 0, i64 0
store double 2.000000e-03, double* %9
%10 = getelementptr inbounds [2 x [3 x double]], [2 x [3 x double]]* %2, i64 0, i64 1, i64 0
%11 = bitcast double* %10 to <2 x double>*
store <2 x double> <double 5.000000e-01, double 5.001000e-01>, <2 x double>* %11
%12 = getelementptr inbounds [2 x [3 x double]], [2 x [3 x double]]* %2, i64 0, i64 1, i64 2
store double 5.000000e-01, double* %12
%13 = bitcast i64* %3 to i8*
store i64 4294967297, i64* %3
%14 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @str, i64 0, i64 0))
%15 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @str.3, i64 0, i64 0))
%16 = bitcast [3 x [3 x double]]* %1 to double**
%17 = bitcast [2 x [3 x double]]* %2 to double**
%18 = bitcast i64* %3 to i32*
%19 = call i32 @sub_spg_standardize_cell(double** %16, double** %17, i32* %18, i32 2, double 1.000000e-01, i32 0, i32 0)
%20 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @str.3, i64 0, i64 0))
%21 = call i32 @sub_spg_standardize_cell(double** %16, double** %17, i32* %18, i32 2, double 1.000000e-01, i32 0, i32 1)
%22 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @str.3, i64 0, i64 0))
%23 = call i32 @sub_spg_standardize_cell(double** %16, double** %17, i32* %18, i32 2, double 1.000000e-01, i32 1, i32 0)
%24 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @str.3, i64 0, i64 0))
%25 = call i32 @sub_spg_standardize_cell(double** %16, double** %17, i32* %18, i32 2, double 1.000000e-01, i32 1, i32 1)
%26 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @str.3, i64 0, i64 0))
ret void
}