#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 *, ...);
scalar_t__ spg_get_schoenflies(char *, double **, double **, int *, int, int);
int test_spg_get_schoenflies(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.5}, {0.3, 0.3, 0},
      {0.7, 0.7, 0}, {0.2, 0.8, 0.5}, {0.8, 0.2, 0.5},
  };
  int types[] = {1, 1, 2, 2, 2, 2};
  int num_atom = 6;
  char symbol[7];
  if (spg_get_schoenflies(symbol, lattice, position, types, num_atom, 1e-5)) {
    printf("*** spg_get_schoenflies ***:\n");
    printf("Schoenflies: %s\n", symbol);
    return 0;
  } else {
    return 1;
  }
}


x86 assembly (clang, -O0):
<test_spg_get_schoenflies>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
lea    -0x50(%rbp),%rdi
xor    %esi,%esi
mov    $0x48,%edx
call   1040 <memset@plt>
movsd  0xea5(%rip),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  0xe98(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  0xe83(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
lea    -0xe0(%rbp),%rdi
lea    0xe80(%rip),%rsi
mov    $0x90,%edx
call   1050 <memcpy@plt>
mov    0xeff(%rip),%rax
mov    %rax,-0x100(%rbp)
mov    0xef9(%rip),%rax
mov    %rax,-0xf8(%rbp)
mov    0xef3(%rip),%rax
mov    %rax,-0xf0(%rbp)
movl   $0x6,-0x104(%rbp)
lea    -0x10b(%rbp),%rdi
lea    -0x50(%rbp),%rsi
lea    -0xe0(%rbp),%rdx
lea    -0x100(%rbp),%rcx
mov    -0x104(%rbp),%r8d
xor    %r9d,%r9d
call   1060 <spg_get_schoenflies@plt>
cmp    $0x0,%rax
je     122f <test_spg_get_schoenflies+0xef>
lea    0xeb1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x10b(%rbp),%rsi
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1236 <test_spg_get_schoenflies+0xf6>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_spg_get_schoenflies>:
push   %r14
push   %rbx
sub    $0x118,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x40(%rsp)
movabs $0x4010000000000000,%rax
mov    %rax,0x30(%rsp)
mov    %rax,0x50(%rsp)
movabs $0x4008000000000000,%rax
mov    %rax,0x70(%rsp)
lea    0xe75(%rip),%rsi
lea    0x80(%rsp),%r14
mov    $0x90,%edx
mov    %r14,%rdi
call   1050 <memcpy@plt>
mov    0xef9(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xedd(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
lea    0x9(%rsp),%rdi
lea    0x30(%rsp),%rsi
lea    0x10(%rsp),%rcx
xor    %ebx,%ebx
mov    %r14,%rdx
mov    $0x6,%r8d
xor    %r9d,%r9d
call   1060 <spg_get_schoenflies@plt>
test   %rax,%rax
je     1200 <test_spg_get_schoenflies+0xc0>
lea    0xed3(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb6(%rip),%rdi
lea    0x9(%rsp),%rsi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    1205 <test_spg_get_schoenflies+0xc5>
mov    $0x1,%ebx
mov    %ebx,%eax
add    $0x118,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.test_spg_get_schoenflies.position = [6 x [3 x double]] [[3 x double] zeroinitializer, [3 x double] [double 5.000000e-01, double 5.000000e-01, double 5.000000e-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 5.000000e-01], [3 x double] [double 8.000000e-01, double 2.000000e-01, double 5.000000e-01]]
@__const.test_spg_get_schoenflies.types = [6 x i32] [i32 1, i32 1, i32 2, i32 2, i32 2, i32 2]
@.str = [30 x i8] c"*** spg_get_schoenflies ***:\0A\00"
@.str.1 = [17 x i8] c"Schoenflies: %s\0A\00"
define i32 @test_spg_get_schoenflies() {
%1 = alloca i32
%2 = alloca [3 x [3 x double]]
%3 = alloca [6 x [3 x double]]
%4 = alloca [6 x i32]
%5 = alloca i32
%6 = alloca [7 x i8]
%7 = bitcast [3 x [3 x double]]* %2 to i8*
%8 = bitcast i8* %7 to [3 x [3 x double]]*
%9 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %8, i32 0, i32 0
%10 = getelementptr inbounds [3 x double], [3 x double]* %9, i32 0, i32 0
store double 4.000000e+00, double* %10
%11 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %8, i32 0, i32 1
%12 = getelementptr inbounds [3 x double], [3 x double]* %11, i32 0, i32 1
store double 4.000000e+00, double* %12
%13 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %8, i32 0, i32 2
%14 = getelementptr inbounds [3 x double], [3 x double]* %13, i32 0, i32 2
store double 3.000000e+00, double* %14
%15 = bitcast [6 x [3 x double]]* %3 to i8*
%16 = bitcast [6 x i32]* %4 to i8*
store i32 6, i32* %5
%17 = getelementptr inbounds [7 x i8], [7 x i8]* %6, i64 0, i64 0
%18 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %2, i64 0, i64 0
%19 = bitcast [3 x double]* %18 to double**
%20 = getelementptr inbounds [6 x [3 x double]], [6 x [3 x double]]* %3, i64 0, i64 0
%21 = bitcast [3 x double]* %20 to double**
%22 = getelementptr inbounds [6 x i32], [6 x i32]* %4, i64 0, i64 0
%23 = load i32, i32* %5
%24 = call i64 @spg_get_schoenflies(i8* %17, double** %19, double** %21, i32* %22, i32 %23, i32 0)
%25 = icmp ne i64 %24, 0
br i1 %25, label %26, label %30
26: ; preds = %0
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%28 = getelementptr inbounds [7 x i8], [7 x i8]* %6, i64 0, i64 0
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* %28)
store i32 0, i32* %1
br label %31
30: ; preds = %0
store i32 1, i32* %1
br label %31
31: ; preds = %30, %26
%32 = load i32, i32* %1
ret i32 %32
}

LLVM IR (-O2):
@__const.test_spg_get_schoenflies.position = [6 x [3 x double]] [[3 x double] zeroinitializer, [3 x double] [double 5.000000e-01, double 5.000000e-01, double 5.000000e-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 5.000000e-01], [3 x double] [double 8.000000e-01, double 2.000000e-01, double 5.000000e-01]]
@__const.test_spg_get_schoenflies.types = [6 x i32] [i32 1, i32 1, i32 2, i32 2, i32 2, i32 2]
@.str.1 = [17 x i8] c"Schoenflies: %s\0A\00"
@str = [29 x i8] c"*** spg_get_schoenflies ***:\00"
define i32 @test_spg_get_schoenflies() {
%1 = alloca [3 x [3 x double]]
%2 = alloca [6 x [3 x double]]
%3 = alloca [6 x i32]
%4 = alloca [7 x i8]
%5 = bitcast [3 x [3 x double]]* %1 to i8*
%6 = 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* %6
%7 = 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* %7
%8 = 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* %8
%9 = bitcast [6 x [3 x double]]* %2 to i8*
%10 = bitcast [6 x i32]* %3 to i8*
%11 = getelementptr inbounds [7 x i8], [7 x i8]* %4, i64 0, i64 0
%12 = bitcast [3 x [3 x double]]* %1 to double**
%13 = bitcast [6 x [3 x double]]* %2 to double**
%14 = getelementptr inbounds [6 x i32], [6 x i32]* %3, i64 0, i64 0
%15 = call i64 @spg_get_schoenflies(i8* %11, double** %12, double** %13, i32* %14, i32 6, i32 0)
%16 = icmp eq i64 %15, 0
br i1 %16, label %20, label %17
17: ; preds = %0
%18 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* %11)
br label %20
20: ; preds = %0, %17
%21 = phi i32 [ 0, %17 ], [ 1, %0 ]
ret i32 %21
}