#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_prim(void) {
  double lattice[3][3] = {{-2.01, 2, 2}, {2, -2.02, 2}, {2, 2, -2.03}};
  double position[][3] = {
      {0.002, 0, 0},
  };
  int types[] = {1};
  int i, j, k, num_atom = 1, num_primitive_atom;
  double symprec = 1e-1;
  printf("*** Example of spg_standardize_cell (BCC primitive) ***:\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_prim>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
lea    -0x50(%rbp),%rdi
lea    0xeca(%rip),%rsi
mov    $0x48,%edx
call   1050 <memcpy@plt>
mov    0xf09(%rip),%rax
mov    %rax,-0x70(%rbp)
mov    0xf06(%rip),%rax
mov    %rax,-0x68(%rbp)
mov    0xf03(%rip),%rax
mov    %rax,-0x60(%rbp)
mov    0xf01(%rip),%eax
mov    %eax,-0x74(%rbp)
movl   $0x1,-0x84(%rbp)
movsd  0xe74(%rip),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
lea    0xf0f(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x7c(%rbp)
cmpl   $0x2,-0x7c(%rbp)
jge    1222 <test_spg_standardize_cell_BCC_prim+0xf2>
movl   $0x0,-0x80(%rbp)
cmpl   $0x2,-0x80(%rbp)
jge    120f <test_spg_standardize_cell_BCC_prim+0xdf>
lea    -0x50(%rbp),%rdi
lea    -0x70(%rbp),%rsi
lea    -0x74(%rbp),%rdx
mov    -0x84(%rbp),%ecx
movsd  -0x90(%rbp),%xmm0
ff
mov    -0x7c(%rbp),%r8d
mov    -0x80(%rbp),%r9d
call   1040 <sub_spg_standardize_cell@plt>
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
mov    -0x80(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x80(%rbp)
jmp    11c4 <test_spg_standardize_cell_BCC_prim+0x94>
jmp    1214 <test_spg_standardize_cell_BCC_prim+0xe4>
mov    -0x7c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x7c(%rbp)
jmp    11b3 <test_spg_standardize_cell_BCC_prim+0x83>
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_spg_standardize_cell_BCC_prim>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x78,%rsp
mov    0xf1e(%rip),%rax
mov    %rax,0x70(%rsp)
movaps 0xf02(%rip),%xmm0
movaps %xmm0,0x60(%rsp)
movaps 0xee6(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps 0xeca(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xeae(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
mov    0xf02(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xee6(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movl   $0x1,0xc(%rsp)
lea    0xeea(%rip),%rdi
call   1030 <puts@plt>
lea    0xf17(%rip),%r14
mov    %r14,%rdi
call   1030 <puts@plt>
lea    0x30(%rsp),%rbx
lea    0x10(%rsp),%r15
lea    0xc(%rsp),%r12
movsd  0xe47(%rip),%xmm0
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r12,%rdx
mov    $0x1,%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    $0x1,%ecx
movsd  0xe10(%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    $0x1,%ecx
movsd  0xde4(%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    $0x1,%ecx
movsd  0xdb8(%rip),%xmm0
mov    $0x1,%r8d
mov    $0x1,%r9d
call   1040 <sub_spg_standardize_cell@plt>
mov    %r14,%rdi
call   1030 <puts@plt>
add    $0x78,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@__const.test_spg_standardize_cell_BCC_prim.lattice = [3 x [3 x double]] [[3 x double] [double -2.010000e+00, double 2.000000e+00, double 2.000000e+00], [3 x double] [double 2.000000e+00, double -2.020000e+00, double 2.000000e+00], [3 x double] [double 2.000000e+00, double 2.000000e+00, double -2.030000e+00]]
@__const.test_spg_standardize_cell_BCC_prim.position = [1 x [3 x double]] [[3 x double] [double 2.000000e-03, double 0.000000e+00, double 0.000000e+00]]
@__const.test_spg_standardize_cell_BCC_prim.types = [1 x i32] [i32 1]
@.str = [58 x i8] c"*** Example of spg_standardize_cell (BCC primitive) ***:\0A\00"
@.str.1 = [56 x i8] c"------------------------------------------------------\0A\00"
define void @test_spg_standardize_cell_BCC_prim() {
%1 = alloca [3 x [3 x double]]
%2 = alloca [1 x [3 x double]]
%3 = alloca [1 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 [1 x [3 x double]]* %2 to i8*
%12 = bitcast [1 x i32]* %3 to i8*
store i32 1, i32* %7
store double 1.000000e-01, double* %9
%13 = call i32 @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0))
%14 = 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 %15
15: ; preds = %38, %0
%16 = load i32, i32* %5
%17 = icmp slt i32 %16, 2
br i1 %17, label %18, label %41
18: ; preds = %15
store i32 0, i32* %6
br label %19
19: ; preds = %34, %18
%20 = load i32, i32* %6
%21 = icmp slt i32 %20, 2
br i1 %21, label %22, label %37
22: ; preds = %19
%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 [1 x [3 x double]], [1 x [3 x double]]* %2, i64 0, i64 0
%26 = bitcast [3 x double]* %25 to double**
%27 = getelementptr inbounds [1 x i32], [1 x i32]* %3, i64 0, i64 0
%28 = load i32, i32* %7
%29 = load double, double* %9
%30 = load i32, i32* %5
%31 = load i32, i32* %6
%32 = call i32 @sub_spg_standardize_cell(double** %24, double** %26, i32* %27, i32 %28, double %29, i32 %30, i32 %31)
%33 = call i32 @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.1, i64 0, i64 0))
br label %34
34: ; preds = %22
%35 = load i32, i32* %6
%36 = add nsw i32 %35, 1
store i32 %36, i32* %6
br label %19
37: ; preds = %19
br label %38
38: ; preds = %37
%39 = load i32, i32* %5
%40 = add nsw i32 %39, 1
store i32 %40, i32* %5
br label %15
41: ; preds = %15
ret void
}

LLVM IR (-O2):
@__const.test_spg_standardize_cell_BCC_prim.lattice = [3 x [3 x double]] [[3 x double] [double -2.010000e+00, double 2.000000e+00, double 2.000000e+00], [3 x double] [double 2.000000e+00, double -2.020000e+00, double 2.000000e+00], [3 x double] [double 2.000000e+00, double 2.000000e+00, double -2.030000e+00]]
@__const.test_spg_standardize_cell_BCC_prim.position = [1 x [3 x double]] [[3 x double] [double 2.000000e-03, double 0.000000e+00, double 0.000000e+00]]
@str = [57 x i8] c"*** Example of spg_standardize_cell (BCC primitive) ***:\00"
@str.3 = [55 x i8] c"------------------------------------------------------\00"
define void @test_spg_standardize_cell_BCC_prim() {
%1 = alloca [3 x [3 x double]]
%2 = alloca [1 x [3 x double]]
%3 = alloca [1 x i32]
%4 = bitcast [3 x [3 x double]]* %1 to i8*
%5 = bitcast [1 x [3 x double]]* %2 to i8*
%6 = bitcast [1 x i32]* %3 to i8*
%7 = getelementptr inbounds [1 x i32], [1 x i32]* %3, i64 0, i64 0
store i32 1, i32* %7
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @str, i64 0, i64 0))
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @str.3, i64 0, i64 0))
%10 = bitcast [3 x [3 x double]]* %1 to double**
%11 = bitcast [1 x [3 x double]]* %2 to double**
%12 = call i32 @sub_spg_standardize_cell(double** %10, double** %11, i32* %7, i32 1, double 1.000000e-01, i32 0, i32 0)
%13 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @str.3, i64 0, i64 0))
%14 = call i32 @sub_spg_standardize_cell(double** %10, double** %11, i32* %7, i32 1, double 1.000000e-01, i32 0, i32 1)
%15 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @str.3, i64 0, i64 0))
%16 = call i32 @sub_spg_standardize_cell(double** %10, double** %11, i32* %7, i32 1, double 1.000000e-01, i32 1, i32 0)
%17 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @str.3, i64 0, i64 0))
%18 = call i32 @sub_spg_standardize_cell(double** %10, double** %11, i32* %7, i32 1, double 1.000000e-01, i32 1, i32 1)
%19 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @str.3, i64 0, i64 0))
ret void
}