#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_multiplicity(double **, double **, int *, int, int);
void test_spg_get_multiplicity(void) {
  double lattice[3][3] = {{4, 0, 0}, {0, 4, 0}, {0, 0, 4}};
  double position[][3] = {{0, 0, 0}, {0.5, 0.5, 0.5}};
  int types[] = {1, 2};
  int num_atom = 2;
  int size;
  size = spg_get_multiplicity(lattice, position, types, num_atom, 1e-5);
  printf("*** Example of spg_get_multiplicity ***:\n");
  printf("Number of symmetry operations: %d\n", size);
}


x86 assembly (clang, -O0):
<test_spg_get_multiplicity>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
lea    -0x50(%rbp),%rdi
xor    %esi,%esi
mov    $0x48,%edx
call   1040 <memset@plt>
movsd  0xeb5(%rip),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  0xea8(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  0xe9b(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
lea    -0x80(%rbp),%rdi
xor    %esi,%esi
mov    $0x30,%edx
call   1040 <memset@plt>
movsd  0xe76(%rip),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  0xe69(%rip),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  0xe5c(%rip),%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    0xe60(%rip),%rax
mov    %rax,-0x88(%rbp)
movl   $0x2,-0x8c(%rbp)
lea    -0x50(%rbp),%rdi
lea    -0x80(%rbp),%rsi
lea    -0x88(%rbp),%rdx
mov    -0x8c(%rbp),%ecx
xor    %r8d,%r8d
call   1050 <spg_get_multiplicity@plt>
mov    %eax,-0x90(%rbp)
lea    0xe2d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x90(%rbp),%esi
lea    0xe43(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_spg_get_multiplicity>:
push   %rbx
sub    $0x90,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x10(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x20(%rsp)
movabs $0x4010000000000000,%rax
mov    %rax,0x10(%rsp)
mov    %rax,0x30(%rsp)
mov    %rax,0x50(%rsp)
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x60(%rsp)
movaps 0xe87(%rip),%xmm0
movups %xmm0,0x78(%rsp)
movabs $0x3fe0000000000000,%rax
mov    %rax,0x88(%rsp)
movabs $0x200000001,%rax
mov    %rax,0x8(%rsp)
lea    0x10(%rsp),%rdi
lea    0x60(%rsp),%rsi
lea    0x8(%rsp),%rdx
mov    $0x2,%ecx
xor    %r8d,%r8d
call   1050 <spg_get_multiplicity@plt>
mov    %eax,%ebx
lea    0xe6f(%rip),%rdi
call   1030 <puts@plt>
lea    0xe40(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x90,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.test_spg_get_multiplicity.types = [2 x i32] [i32 1, i32 2]
@.str = [42 x i8] c"*** Example of spg_get_multiplicity ***:\0A\00"
@.str.1 = [35 x i8] c"Number of symmetry operations: %d\0A\00"
define void @test_spg_get_multiplicity() {
%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 = bitcast [3 x [3 x double]]* %1 to i8*
%7 = bitcast i8* %6 to [3 x [3 x double]]*
%8 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %7, i32 0, i32 0
%9 = getelementptr inbounds [3 x double], [3 x double]* %8, i32 0, i32 0
store double 4.000000e+00, double* %9
%10 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %7, i32 0, i32 1
%11 = getelementptr inbounds [3 x double], [3 x double]* %10, i32 0, i32 1
store double 4.000000e+00, double* %11
%12 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %7, i32 0, i32 2
%13 = getelementptr inbounds [3 x double], [3 x double]* %12, i32 0, i32 2
store double 4.000000e+00, double* %13
%14 = bitcast [2 x [3 x double]]* %2 to i8*
%15 = bitcast i8* %14 to [2 x [3 x double]]*
%16 = getelementptr inbounds [2 x [3 x double]], [2 x [3 x double]]* %15, i32 0, i32 1
%17 = getelementptr inbounds [3 x double], [3 x double]* %16, i32 0, i32 0
store double 5.000000e-01, double* %17
%18 = getelementptr inbounds [3 x double], [3 x double]* %16, i32 0, i32 1
store double 5.000000e-01, double* %18
%19 = getelementptr inbounds [3 x double], [3 x double]* %16, i32 0, i32 2
store double 5.000000e-01, double* %19
%20 = bitcast [2 x i32]* %3 to i8*
store i32 2, i32* %4
%21 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %1, i64 0, i64 0
%22 = bitcast [3 x double]* %21 to double**
%23 = getelementptr inbounds [2 x [3 x double]], [2 x [3 x double]]* %2, i64 0, i64 0
%24 = bitcast [3 x double]* %23 to double**
%25 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 0
%26 = load i32, i32* %4
%27 = call i32 @spg_get_multiplicity(double** %22, double** %24, i32* %25, i32 %26, i32 0)
store i32 %27, i32* %5
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
%29 = load i32, i32* %5
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i32 %29)
ret void
}

LLVM IR (-O2):
@.str.1 = [35 x i8] c"Number of symmetry operations: %d\0A\00"
@str = [41 x i8] c"*** Example of spg_get_multiplicity ***:\00"
define void @test_spg_get_multiplicity() {
%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 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 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 1, i64 0
%10 = bitcast double* %9 to <2 x double>*
store <2 x double> <double 5.000000e-01, double 5.000000e-01>, <2 x double>* %10
%11 = 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* %11
%12 = bitcast i64* %3 to i8*
store i64 8589934593, i64* %3
%13 = bitcast [3 x [3 x double]]* %1 to double**
%14 = bitcast [2 x [3 x double]]* %2 to double**
%15 = bitcast i64* %3 to i32*
%16 = call i32 @spg_get_multiplicity(double** %13, double** %14, i32* %15, i32 2, i32 0)
%17 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str, i64 0, i64 0))
%18 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i32 %16)
ret void
}