#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_symmetry_from_database(int ***, double **, int);
int test_spg_get_symmetry_from_database(void) {
  int rotations[192][3][3];
  double translations[192][3];
  int i, j, size;
  size = spg_get_symmetry_from_database(rotations, translations, 460);
  if (size) {
    printf("*** spg_get_symmetry_from_database ***:\n");
    for (i = 0; i < size; i++) {
      printf("--- %d ---\n", i + 1);
      for (j = 0; j < 3; j++) {
        printf("%2d %2d %2d\n", rotations[i][j][0], rotations[i][j][1],
               rotations[i][j][2]);
      }
      printf("%f %f %f\n", translations[i][0], translations[i][1],
             translations[i][2]);
    }
    return 0;
  } else {
    return 1;
  }
}


x86 assembly (clang, -O0):
<test_spg_get_symmetry_from_database>:
push   %rbp
mov    %rsp,%rbp
sub    $0x2d20,%rsp
lea    -0x1b10(%rbp),%rdi
lea    -0x2d10(%rbp),%rsi
mov    $0x1cc,%edx
call   1040 <spg_get_symmetry_from_database@plt>
mov    %eax,-0x2d1c(%rbp)
cmpl   $0x0,-0x2d1c(%rbp)
je     12bc <test_spg_get_symmetry_from_database+0x19c>
lea    0xea3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x2d14(%rbp)
mov    -0x2d14(%rbp),%eax
cmp    -0x2d1c(%rbp),%eax
jge    12b0 <test_spg_get_symmetry_from_database+0x190>
mov    -0x2d14(%rbp),%esi
add    $0x1,%esi
lea    0xe99(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x2d18(%rbp)
cmpl   $0x3,-0x2d18(%rbp)
jge    1241 <test_spg_get_symmetry_from_database+0x121>
movslq -0x2d14(%rbp),%rcx
lea    -0x1b10(%rbp),%rax
imul   $0x24,%rcx,%rcx
add    %rcx,%rax
movslq -0x2d18(%rbp),%rcx
imul   $0xc,%rcx,%rcx
add    %rcx,%rax
mov    (%rax),%esi
movslq -0x2d14(%rbp),%rcx
lea    -0x1b10(%rbp),%rax
imul   $0x24,%rcx,%rcx
add    %rcx,%rax
movslq -0x2d18(%rbp),%rcx
imul   $0xc,%rcx,%rcx
add    %rcx,%rax
mov    0x4(%rax),%edx
movslq -0x2d14(%rbp),%rcx
lea    -0x1b10(%rbp),%rax
imul   $0x24,%rcx,%rcx
add    %rcx,%rax
movslq -0x2d18(%rbp),%rcx
imul   $0xc,%rcx,%rcx
add    %rcx,%rax
mov    0x8(%rax),%ecx
lea    0xe0f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x2d18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2d18(%rbp)
jmp    11a1 <test_spg_get_symmetry_from_database+0x81>
movslq -0x2d14(%rbp),%rcx
lea    -0x2d10(%rbp),%rax
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
movsd  (%rax),%xmm0
movslq -0x2d14(%rbp),%rcx
lea    -0x2d10(%rbp),%rax
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
movsd  0x8(%rax),%xmm1
movslq -0x2d14(%rbp),%rcx
lea    -0x2d10(%rbp),%rax
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
movsd  0x10(%rax),%xmm2
lea    0xdad(%rip),%rdi
mov    $0x3,%al
call   1030 <printf@plt>
mov    -0x2d14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2d14(%rbp)
jmp    116e <test_spg_get_symmetry_from_database+0x4e>
movl   $0x0,-0x4(%rbp)
jmp    12c3 <test_spg_get_symmetry_from_database+0x1a3>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x2d20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_spg_get_symmetry_from_database>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x2d08,%rsp
mov    %rsp,%rdi
lea    0x1b00(%rsp),%rsi
mov    $0x1cc,%edx
call   1050 <spg_get_symmetry_from_database@plt>
test   %eax,%eax
je     122a <test_spg_get_symmetry_from_database+0xfa>
mov    %eax,%ebx
lea    0xebc(%rip),%rdi
call   1030 <puts@plt>
test   %ebx,%ebx
jle    1226 <test_spg_get_symmetry_from_database+0xf6>
mov    %ebx,%eax
lea    0x1b10(%rsp),%rbx
shl    $0x2,%rax
lea    (%rax,%rax,8),%r14
mov    $0x1,%ebp
lea    0xe7a(%rip),%r13
lea    0xe80(%rip),%r12
xor    %r15d,%r15d
nopl   0x0(%rax)
lea    0xe59(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    (%rsp,%r15,1),%esi
mov    0x4(%rsp,%r15,1),%edx
mov    0x8(%rsp,%r15,1),%ecx
mov    %r13,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0xc(%rsp,%r15,1),%esi
mov    0x10(%rsp,%r15,1),%edx
mov    0x14(%rsp,%r15,1),%ecx
mov    %r13,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x18(%rsp,%r15,1),%esi
mov    0x1c(%rsp,%r15,1),%edx
mov    0x20(%rsp,%r15,1),%ecx
mov    %r13,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movsd  -0x10(%rbx),%xmm0
movsd  -0x8(%rbx),%xmm1
movsd  (%rbx),%xmm2
mov    %r12,%rdi
mov    $0x3,%al
call   1040 <printf@plt>
add    $0x18,%rbx
add    $0x24,%r15
add    $0x1,%ebp
cmp    %r15,%r14
jne    11a0 <test_spg_get_symmetry_from_database+0x70>
xor    %eax,%eax
jmp    122f <test_spg_get_symmetry_from_database+0xff>
mov    $0x1,%eax
add    $0x2d08,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [41 x i8] c"*** spg_get_symmetry_from_database ***:\0A\00"
@.str.1 = [12 x i8] c"--- %d ---\0A\00"
@.str.2 = [13 x i8] c"%2d %2d %2d\0A\00"
@.str.3 = [10 x i8] c"%f %f %f\0A\00"
define i32 @test_spg_get_symmetry_from_database() {
%1 = alloca i32
%2 = alloca [192 x [3 x [3 x i32]]]
%3 = alloca [192 x [3 x double]]
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = getelementptr inbounds [192 x [3 x [3 x i32]]], [192 x [3 x [3 x i32]]]* %2, i64 0, i64 0
%8 = bitcast [3 x [3 x i32]]* %7 to i32***
%9 = getelementptr inbounds [192 x [3 x double]], [192 x [3 x double]]* %3, i64 0, i64 0
%10 = bitcast [3 x double]* %9 to double**
%11 = call i32 @spg_get_symmetry_from_database(i32*** %8, double** %10, i32 460)
store i32 %11, i32* %6
%12 = load i32, i32* %6
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %77
14: ; preds = %0
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %4
br label %16
16: ; preds = %73, %14
%17 = load i32, i32* %4
%18 = load i32, i32* %6
%19 = icmp slt i32 %17, %18
br i1 %19, label %20, label %76
20: ; preds = %16
%21 = load i32, i32* %4
%22 = add nsw i32 %21, 1
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 %22)
store i32 0, i32* %5
br label %24
24: ; preds = %53, %20
%25 = load i32, i32* %5
%26 = icmp slt i32 %25, 3
br i1 %26, label %27, label %56
27: ; preds = %24
%28 = load i32, i32* %4
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds [192 x [3 x [3 x i32]]], [192 x [3 x [3 x i32]]]* %2, i64 0, i64 %29
%31 = load i32, i32* %5
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds [3 x [3 x i32]], [3 x [3 x i32]]* %30, i64 0, i64 %32
%34 = getelementptr inbounds [3 x i32], [3 x i32]* %33, i64 0, i64 0
%35 = load i32, i32* %34
%36 = load i32, i32* %4
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds [192 x [3 x [3 x i32]]], [192 x [3 x [3 x i32]]]* %2, i64 0, i64 %37
%39 = load i32, i32* %5
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds [3 x [3 x i32]], [3 x [3 x i32]]* %38, i64 0, i64 %40
%42 = getelementptr inbounds [3 x i32], [3 x i32]* %41, i64 0, i64 1
%43 = load i32, i32* %42
%44 = load i32, i32* %4
%45 = sext i32 %44 to i64
%46 = getelementptr inbounds [192 x [3 x [3 x i32]]], [192 x [3 x [3 x i32]]]* %2, i64 0, i64 %45
%47 = load i32, i32* %5
%48 = sext i32 %47 to i64
%49 = getelementptr inbounds [3 x [3 x i32]], [3 x [3 x i32]]* %46, i64 0, i64 %48
%50 = getelementptr inbounds [3 x i32], [3 x i32]* %49, i64 0, i64 2
%51 = load i32, i32* %50
%52 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i32 %35, i32 %43, i32 %51)
br label %53
53: ; preds = %27
%54 = load i32, i32* %5
%55 = add nsw i32 %54, 1
store i32 %55, i32* %5
br label %24
56: ; preds = %24
%57 = load i32, i32* %4
%58 = sext i32 %57 to i64
%59 = getelementptr inbounds [192 x [3 x double]], [192 x [3 x double]]* %3, i64 0, i64 %58
%60 = getelementptr inbounds [3 x double], [3 x double]* %59, i64 0, i64 0
%61 = load double, double* %60
%62 = load i32, i32* %4
%63 = sext i32 %62 to i64
%64 = getelementptr inbounds [192 x [3 x double]], [192 x [3 x double]]* %3, i64 0, i64 %63
%65 = getelementptr inbounds [3 x double], [3 x double]* %64, i64 0, i64 1
%66 = load double, double* %65
%67 = load i32, i32* %4
%68 = sext i32 %67 to i64
%69 = getelementptr inbounds [192 x [3 x double]], [192 x [3 x double]]* %3, i64 0, i64 %68
%70 = getelementptr inbounds [3 x double], [3 x double]* %69, i64 0, i64 2
%71 = load double, double* %70
%72 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), double %61, double %66, double %71)
br label %73
73: ; preds = %56
%74 = load i32, i32* %4
%75 = add nsw i32 %74, 1
store i32 %75, i32* %4
br label %16
76: ; preds = %16
store i32 0, i32* %1
br label %78
77: ; preds = %0
store i32 1, i32* %1
br label %78
78: ; preds = %77, %76
%79 = load i32, i32* %1
ret i32 %79
}

LLVM IR (-O2):
@.str.1 = [12 x i8] c"--- %d ---\0A\00"
@.str.2 = [13 x i8] c"%2d %2d %2d\0A\00"
@.str.3 = [10 x i8] c"%f %f %f\0A\00"
@str = [40 x i8] c"*** spg_get_symmetry_from_database ***:\00"
define i32 @test_spg_get_symmetry_from_database() {
%1 = alloca [192 x [3 x [3 x i32]]]
%2 = alloca [192 x [3 x double]]
%3 = bitcast [192 x [3 x [3 x i32]]]* %1 to i8*
%4 = bitcast [192 x [3 x double]]* %2 to i8*
%5 = bitcast [192 x [3 x [3 x i32]]]* %1 to i32***
%6 = bitcast [192 x [3 x double]]* %2 to double**
%7 = call i32 @spg_get_symmetry_from_database(i32*** %5, double** %6, i32 460)
%8 = icmp eq i32 %7, 0
br i1 %8, label %48, label %9
9: ; preds = %0
%10 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str, i64 0, i64 0))
%11 = icmp sgt i32 %7, 0
br i1 %11, label %12, label %48
12: ; preds = %9
%13 = zext i32 %7 to i64
br label %14
14: ; preds = %12, %14
%15 = phi i64 [ 0, %12 ], [ %16, %14 ]
%16 = add nuw nsw i64 %15, 1
%17 = trunc i64 %16 to i32
%18 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 %17)
%19 = getelementptr inbounds [192 x [3 x [3 x i32]]], [192 x [3 x [3 x i32]]]* %1, i64 0, i64 %15, i64 0, i64 0
%20 = load i32, i32* %19
%21 = getelementptr inbounds [192 x [3 x [3 x i32]]], [192 x [3 x [3 x i32]]]* %1, i64 0, i64 %15, i64 0, i64 1
%22 = load i32, i32* %21
%23 = getelementptr inbounds [192 x [3 x [3 x i32]]], [192 x [3 x [3 x i32]]]* %1, i64 0, i64 %15, i64 0, i64 2
%24 = load i32, i32* %23
%25 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i32 %20, i32 %22, i32 %24)
%26 = getelementptr inbounds [192 x [3 x [3 x i32]]], [192 x [3 x [3 x i32]]]* %1, i64 0, i64 %15, i64 1, i64 0
%27 = load i32, i32* %26
%28 = getelementptr inbounds [192 x [3 x [3 x i32]]], [192 x [3 x [3 x i32]]]* %1, i64 0, i64 %15, i64 1, i64 1
%29 = load i32, i32* %28
%30 = getelementptr inbounds [192 x [3 x [3 x i32]]], [192 x [3 x [3 x i32]]]* %1, i64 0, i64 %15, i64 1, i64 2
%31 = load i32, i32* %30
%32 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i32 %27, i32 %29, i32 %31)
%33 = getelementptr inbounds [192 x [3 x [3 x i32]]], [192 x [3 x [3 x i32]]]* %1, i64 0, i64 %15, i64 2, i64 0
%34 = load i32, i32* %33
%35 = getelementptr inbounds [192 x [3 x [3 x i32]]], [192 x [3 x [3 x i32]]]* %1, i64 0, i64 %15, i64 2, i64 1
%36 = load i32, i32* %35
%37 = getelementptr inbounds [192 x [3 x [3 x i32]]], [192 x [3 x [3 x i32]]]* %1, i64 0, i64 %15, i64 2, i64 2
%38 = load i32, i32* %37
%39 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i32 %34, i32 %36, i32 %38)
%40 = getelementptr inbounds [192 x [3 x double]], [192 x [3 x double]]* %2, i64 0, i64 %15, i64 0
%41 = load double, double* %40
%42 = getelementptr inbounds [192 x [3 x double]], [192 x [3 x double]]* %2, i64 0, i64 %15, i64 1
%43 = load double, double* %42
%44 = getelementptr inbounds [192 x [3 x double]], [192 x [3 x double]]* %2, i64 0, i64 %15, i64 2
%45 = load double, double* %44
%46 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), double %41, double %43, double %45)
%47 = icmp eq i64 %16, %13
br i1 %47, label %48, label %14
48: ; preds = %14, %9, %0
%49 = phi i32 [ 1, %0 ], [ 0, %9 ], [ 0, %14 ]
ret i32 %49
}