#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_standardize_cell(double **, double **, int *, int const, int const,
                         int const, double const);
int sub_spg_standardize_cell(double lattice[3][3], double position[][3],
                             int types[], const int num_atom,
                             const double symprec, const int to_primitive,
                             const int no_idealize) {
  int i, num_primitive_atom;
  double lat[3][3], pos[num_atom][3];
  int typ[num_atom];
  for (i = 0; i < 3; i++) {
    lat[i][0] = lattice[i][0];
    lat[i][1] = lattice[i][1];
    lat[i][2] = lattice[i][2];
  }
  for (i = 0; i < num_atom; i++) {
    pos[i][0] = position[i][0];
    pos[i][1] = position[i][1];
    pos[i][2] = position[i][2];
    typ[i] = types[i];
  }
  num_primitive_atom = spg_standardize_cell(lat, pos, typ, num_atom,
                                            to_primitive, no_idealize, symprec);
  if (num_primitive_atom) {
    printf("VASP POSCAR format: ");
    if (to_primitive == 0) {
      printf("to_primitive=0 and ");
    } else {
      printf("to_primitive=1 and ");
    }
    if (no_idealize == 0) {
      printf("no_idealize=0\n");
    } else {
      printf("no_idealize=1\n");
    }
    printf("1.0\n");
    for (i = 0; i < 3; i++) {
      printf("%f %f %f\n", lat[0][i], lat[1][i], lat[2][i]);
    }
    printf("%d\n", num_primitive_atom);
    printf("Direct\n");
    for (i = 0; i < num_primitive_atom; i++) {
      printf("%f %f %f\n", pos[i][0], pos[i][1], pos[i][2]);
    }
    return 0;
  } else {
    return 1;
  }
}


x86 assembly (clang, -O0):
<sub_spg_standardize_cell>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
movsd  %xmm0,-0x30(%rbp)
mov    %r8d,-0x34(%rbp)
mov    %r9d,-0x38(%rbp)
mov    -0x24(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x98(%rbp)
lea    (%rax,%rax,2),%rcx
lea    0xf(,%rcx,8),%rdx
movabs $0x3ffffffff0,%rcx
and    %rcx,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0xc0(%rbp)
mov    %rcx,%rsp
mov    %rax,-0xa0(%rbp)
mov    -0x24(%rbp),%eax
lea    0xf(,%rax,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0xb8(%rbp)
mov    %rcx,%rsp
mov    %rax,-0xa8(%rbp)
movl   $0x0,-0x3c(%rbp)
cmpl   $0x3,-0x3c(%rbp)
jge    1248 <sub_spg_standardize_cell+0x128>
mov    -0x10(%rbp),%rax
movslq -0x3c(%rbp),%rcx
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
movsd  (%rax),%xmm0
movslq -0x3c(%rbp),%rcx
lea    -0x90(%rbp),%rax
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
movsd  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movslq -0x3c(%rbp),%rcx
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
movsd  0x8(%rax),%xmm0
movslq -0x3c(%rbp),%rcx
lea    -0x90(%rbp),%rax
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
movsd  %xmm0,0x8(%rax)
mov    -0x10(%rbp),%rax
movslq -0x3c(%rbp),%rcx
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
movsd  0x10(%rax),%xmm0
movslq -0x3c(%rbp),%rcx
lea    -0x90(%rbp),%rax
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
movsd  %xmm0,0x10(%rax)
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    11b1 <sub_spg_standardize_cell+0x91>
movl   $0x0,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    12f9 <sub_spg_standardize_cell+0x1d9>
mov    -0xb8(%rbp),%rax
mov    -0xc0(%rbp),%rcx
mov    -0x18(%rbp),%rdx
movslq -0x3c(%rbp),%rsi
imul   $0x18,%rsi,%rsi
add    %rsi,%rdx
movsd  (%rdx),%xmm0
movslq -0x3c(%rbp),%rdx
imul   $0x18,%rdx,%rsi
mov    %rcx,%rdx
add    %rsi,%rdx
movsd  %xmm0,(%rdx)
mov    -0x18(%rbp),%rdx
movslq -0x3c(%rbp),%rsi
imul   $0x18,%rsi,%rsi
add    %rsi,%rdx
movsd  0x8(%rdx),%xmm0
movslq -0x3c(%rbp),%rdx
imul   $0x18,%rdx,%rsi
mov    %rcx,%rdx
add    %rsi,%rdx
movsd  %xmm0,0x8(%rdx)
mov    -0x18(%rbp),%rdx
movslq -0x3c(%rbp),%rsi
imul   $0x18,%rsi,%rsi
add    %rsi,%rdx
movsd  0x10(%rdx),%xmm0
movslq -0x3c(%rbp),%rdx
imul   $0x18,%rdx,%rdx
add    %rdx,%rcx
movsd  %xmm0,0x10(%rcx)
mov    -0x20(%rbp),%rcx
movslq -0x3c(%rbp),%rdx
mov    (%rcx,%rdx,4),%edx
movslq -0x3c(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    124f <sub_spg_standardize_cell+0x12f>
mov    -0xb8(%rbp),%rdx
mov    -0xc0(%rbp),%rsi
lea    -0x90(%rbp),%rdi
mov    -0x24(%rbp),%ecx
mov    -0x34(%rbp),%r8d
mov    -0x38(%rbp),%r9d
movsd  -0x30(%rbp),%xmm0
call   1040 <spg_standardize_cell@plt>
mov    %eax,-0x40(%rbp)
cmpl   $0x0,-0x40(%rbp)
je     1490 <sub_spg_standardize_cell+0x370>
lea    0xcc9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x0,-0x34(%rbp)
jne    135b <sub_spg_standardize_cell+0x23b>
lea    0xcc6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1369 <sub_spg_standardize_cell+0x249>
lea    0xcc7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x0,-0x38(%rbp)
jne    1386 <sub_spg_standardize_cell+0x266>
lea    0xcc3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1394 <sub_spg_standardize_cell+0x274>
lea    0xcbf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xcc0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x3c(%rbp)
cmpl   $0x3,-0x3c(%rbp)
jge    13f0 <sub_spg_standardize_cell+0x2d0>
movslq -0x3c(%rbp),%rax
movsd  -0x90(%rbp,%rax,8),%xmm0
ff ff
movslq -0x3c(%rbp),%rax
movsd  -0x78(%rbp,%rax,8),%xmm1
movslq -0x3c(%rbp),%rax
movsd  -0x60(%rbp,%rax,8),%xmm2
lea    0xc85(%rip),%rdi
mov    $0x3,%al
call   1030 <printf@plt>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    13a9 <sub_spg_standardize_cell+0x289>
mov    -0x40(%rbp),%esi
lea    0xc70(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xc66(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
cmp    -0x40(%rbp),%eax
jge    147a <sub_spg_standardize_cell+0x35a>
mov    -0xc0(%rbp),%rax
movslq -0x3c(%rbp),%rcx
imul   $0x18,%rcx,%rdx
mov    %rax,%rcx
add    %rdx,%rcx
movsd  (%rcx),%xmm0
movslq -0x3c(%rbp),%rcx
imul   $0x18,%rcx,%rdx
mov    %rax,%rcx
add    %rdx,%rcx
movsd  0x8(%rcx),%xmm1
movslq -0x3c(%rbp),%rcx
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
movsd  0x10(%rax),%xmm2
lea    0xbfb(%rip),%rdi
mov    $0x3,%al
call   1030 <printf@plt>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    1416 <sub_spg_standardize_cell+0x2f6>
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0xac(%rbp)
jmp    14a1 <sub_spg_standardize_cell+0x381>
movl   $0x1,-0x4(%rbp)
movl   $0x1,-0xac(%rbp)
mov    -0x98(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sub_spg_standardize_cell>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x68,%rsp
mov    %r9d,-0x30(%rbp)
mov    %r8d,-0x2c(%rbp)
mov    %ecx,%ebx
mov    %rsp,-0x40(%rbp)
mov    %ecx,%r15d
lea    (%r15,%r15,2),%rax
lea    0xf(,%rax,8),%rax
movabs $0x3ffffffff0,%rcx
and    %rax,%rcx
mov    %rsp,%r12
sub    %rcx,%r12
mov    %r12,%rsp
mov    %rsp,%r14
lea    0xf(,%r15,4),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%r14
mov    %r14,%rsp
movups (%rdi),%xmm1
movaps %xmm1,-0x90(%rbp)
movups 0x10(%rdi),%xmm1
movaps %xmm1,-0x80(%rbp)
movups 0x20(%rdi),%xmm1
movaps %xmm1,-0x70(%rbp)
movups 0x30(%rdi),%xmm1
movaps %xmm1,-0x60(%rbp)
movsd  0x40(%rdi),%xmm1
movsd  %xmm1,-0x50(%rbp)
test   %ebx,%ebx
jle    127c <sub_spg_standardize_cell+0x13c>
mov    %rsi,%r13
movsd  %xmm0,-0x38(%rbp)
lea    0x0(,%r15,4),%rax
mov    %r14,%rdi
mov    %rdx,%rsi
mov    %rax,%rdx
call   1050 <memcpy@plt>
cmp    $0x1,%ebx
jne    11f4 <sub_spg_standardize_cell+0xb4>
xor    %eax,%eax
jmp    1250 <sub_spg_standardize_cell+0x110>
mov    %r15d,%ecx
and    $0xfffffffe,%ecx
mov    $0x28,%edx
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movups -0x28(%r13,%rdx,1),%xmm0
movaps %xmm0,-0x28(%r12,%rdx,1)
movsd  -0x18(%r13,%rdx,1),%xmm0
movsd  %xmm0,-0x18(%r12,%rdx,1)
movups -0x10(%r13,%rdx,1),%xmm0
movups %xmm0,-0x10(%r12,%rdx,1)
movsd  0x0(%r13,%rdx,1),%xmm0
movsd  %xmm0,(%r12,%rdx,1)
add    $0x2,%rax
add    $0x30,%rdx
cmp    %rax,%rcx
jne    1210 <sub_spg_standardize_cell+0xd0>
test   $0x1,%r15b
movsd  -0x38(%rbp),%xmm0
je     127c <sub_spg_standardize_cell+0x13c>
shl    $0x3,%rax
lea    (%rax,%rax,2),%rax
movups 0x0(%r13,%rax,1),%xmm1
movups %xmm1,(%r12,%rax,1)
movsd  0x10(%r13,%rax,1),%xmm1
movsd  %xmm1,0x10(%r12,%rax,1)
lea    -0x90(%rbp),%rdi
mov    %r12,%rsi
mov    %r14,%rdx
mov    %ebx,%ecx
mov    -0x2c(%rbp),%ebx
mov    %ebx,%r8d
mov    -0x30(%rbp),%r14d
mov    %r14d,%r9d
call   1060 <spg_standardize_cell@plt>
test   %eax,%eax
je     13bc <sub_spg_standardize_cell+0x27c>
mov    %eax,%r13d
lea    0xd51(%rip),%rdi
xor    %r15d,%r15d
xor    %eax,%eax
call   1040 <printf@plt>
test   %ebx,%ebx
lea    0xd53(%rip),%rax
lea    0xd60(%rip),%rdi
cmove  %rax,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
test   %r14d,%r14d
lea    0xd86(%rip),%rax
lea    0xd66(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
lea    0xd64(%rip),%rdi
call   1030 <puts@plt>
movsd  -0x90(%rbp),%xmm0
ff
movsd  -0x78(%rbp),%xmm1
movsd  -0x60(%rbp),%xmm2
lea    0xd2a(%rip),%r14
mov    %r14,%rdi
mov    $0x3,%al
call   1040 <printf@plt>
movsd  -0x88(%rbp),%xmm0
ff
movsd  -0x70(%rbp),%xmm1
movsd  -0x58(%rbp),%xmm2
mov    %r14,%rdi
mov    $0x3,%al
call   1040 <printf@plt>
movsd  -0x80(%rbp),%xmm0
movsd  -0x68(%rbp),%xmm1
movsd  -0x50(%rbp),%xmm2
mov    %r14,%rdi
mov    $0x3,%al
call   1040 <printf@plt>
lea    0xcee(%rip),%rdi
mov    %r13d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xcf3(%rip),%rdi
call   1030 <puts@plt>
test   %r13d,%r13d
jle    13c2 <sub_spg_standardize_cell+0x282>
mov    %r13d,%eax
shl    $0x3,%rax
lea    (%rax,%rax,2),%r15
lea    0xcb7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
movsd  (%r12,%rbx,1),%xmm0
movsd  0x8(%r12,%rbx,1),%xmm1
movsd  0x10(%r12,%rbx,1),%xmm2
mov    %r14,%rdi
mov    $0x3,%al
call   1040 <printf@plt>
add    $0x18,%rbx
cmp    %rbx,%r15
jne    1390 <sub_spg_standardize_cell+0x250>
xor    %r15d,%r15d
jmp    13c2 <sub_spg_standardize_cell+0x282>
mov    $0x1,%r15d
mov    -0x40(%rbp),%rsp
mov    %r15d,%eax
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [21 x i8] c"VASP POSCAR format: \00"
@.str.1 = [20 x i8] c"to_primitive=0 and \00"
@.str.2 = [20 x i8] c"to_primitive=1 and \00"
@.str.3 = [15 x i8] c"no_idealize=0\0A\00"
@.str.4 = [15 x i8] c"no_idealize=1\0A\00"
@.str.5 = [5 x i8] c"1.0\0A\00"
@.str.6 = [10 x i8] c"%f %f %f\0A\00"
@.str.7 = [4 x i8] c"%d\0A\00"
@.str.8 = [8 x i8] c"Direct\0A\00"
define i32 @sub_spg_standardize_cell([3 x double]* %0, [3 x double]* %1, i32* %2, i32 %3, double %4, i32 %5, i32 %6) {
%8 = alloca i32
%9 = alloca [3 x double]*
%10 = alloca [3 x double]*
%11 = alloca i32*
%12 = alloca i32
%13 = alloca double
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca [3 x [3 x double]]
%19 = alloca i8*
%20 = alloca i64
%21 = alloca i64
%22 = alloca i32
store [3 x double]* %0, [3 x double]** %9
store [3 x double]* %1, [3 x double]** %10
store i32* %2, i32** %11
store i32 %3, i32* %12
store double %4, double* %13
store i32 %5, i32* %14
store i32 %6, i32* %15
%23 = load i32, i32* %12
%24 = zext i32 %23 to i64
%25 = call i8* @llvm.stacksave()
store i8* %25, i8** %19
%26 = alloca [3 x double], i64 %24
store i64 %24, i64* %20
%27 = load i32, i32* %12
%28 = zext i32 %27 to i64
%29 = alloca i32, i64 %28
store i64 %28, i64* %21
store i32 0, i32* %16
br label %30
30: ; preds = %64, %7
%31 = load i32, i32* %16
%32 = icmp slt i32 %31, 3
br i1 %32, label %33, label %67
33: ; preds = %30
%34 = load [3 x double]*, [3 x double]** %9
%35 = load i32, i32* %16
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds [3 x double], [3 x double]* %34, i64 %36
%38 = getelementptr inbounds [3 x double], [3 x double]* %37, i64 0, i64 0
%39 = load double, double* %38
%40 = load i32, i32* %16
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %18, i64 0, i64 %41
%43 = getelementptr inbounds [3 x double], [3 x double]* %42, i64 0, i64 0
store double %39, double* %43
%44 = load [3 x double]*, [3 x double]** %9
%45 = load i32, i32* %16
%46 = sext i32 %45 to i64
%47 = getelementptr inbounds [3 x double], [3 x double]* %44, i64 %46
%48 = getelementptr inbounds [3 x double], [3 x double]* %47, i64 0, i64 1
%49 = load double, double* %48
%50 = load i32, i32* %16
%51 = sext i32 %50 to i64
%52 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %18, i64 0, i64 %51
%53 = getelementptr inbounds [3 x double], [3 x double]* %52, i64 0, i64 1
store double %49, double* %53
%54 = load [3 x double]*, [3 x double]** %9
%55 = load i32, i32* %16
%56 = sext i32 %55 to i64
%57 = getelementptr inbounds [3 x double], [3 x double]* %54, i64 %56
%58 = getelementptr inbounds [3 x double], [3 x double]* %57, i64 0, i64 2
%59 = load double, double* %58
%60 = load i32, i32* %16
%61 = sext i32 %60 to i64
%62 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %18, i64 0, i64 %61
%63 = getelementptr inbounds [3 x double], [3 x double]* %62, i64 0, i64 2
store double %59, double* %63
br label %64
64: ; preds = %33
%65 = load i32, i32* %16
%66 = add nsw i32 %65, 1
store i32 %66, i32* %16
br label %30
67: ; preds = %30
store i32 0, i32* %16
br label %68
68: ; preds = %111, %67
%69 = load i32, i32* %16
%70 = load i32, i32* %12
%71 = icmp slt i32 %69, %70
br i1 %71, label %72, label %114
72: ; preds = %68
%73 = load [3 x double]*, [3 x double]** %10
%74 = load i32, i32* %16
%75 = sext i32 %74 to i64
%76 = getelementptr inbounds [3 x double], [3 x double]* %73, i64 %75
%77 = getelementptr inbounds [3 x double], [3 x double]* %76, i64 0, i64 0
%78 = load double, double* %77
%79 = load i32, i32* %16
%80 = sext i32 %79 to i64
%81 = getelementptr inbounds [3 x double], [3 x double]* %26, i64 %80
%82 = getelementptr inbounds [3 x double], [3 x double]* %81, i64 0, i64 0
store double %78, double* %82
%83 = load [3 x double]*, [3 x double]** %10
%84 = load i32, i32* %16
%85 = sext i32 %84 to i64
%86 = getelementptr inbounds [3 x double], [3 x double]* %83, i64 %85
%87 = getelementptr inbounds [3 x double], [3 x double]* %86, i64 0, i64 1
%88 = load double, double* %87
%89 = load i32, i32* %16
%90 = sext i32 %89 to i64
%91 = getelementptr inbounds [3 x double], [3 x double]* %26, i64 %90
%92 = getelementptr inbounds [3 x double], [3 x double]* %91, i64 0, i64 1
store double %88, double* %92
%93 = load [3 x double]*, [3 x double]** %10
%94 = load i32, i32* %16
%95 = sext i32 %94 to i64
%96 = getelementptr inbounds [3 x double], [3 x double]* %93, i64 %95
%97 = getelementptr inbounds [3 x double], [3 x double]* %96, i64 0, i64 2
%98 = load double, double* %97
%99 = load i32, i32* %16
%100 = sext i32 %99 to i64
%101 = getelementptr inbounds [3 x double], [3 x double]* %26, i64 %100
%102 = getelementptr inbounds [3 x double], [3 x double]* %101, i64 0, i64 2
store double %98, double* %102
%103 = load i32*, i32** %11
%104 = load i32, i32* %16
%105 = sext i32 %104 to i64
%106 = getelementptr inbounds i32, i32* %103, i64 %105
%107 = load i32, i32* %106
%108 = load i32, i32* %16
%109 = sext i32 %108 to i64
%110 = getelementptr inbounds i32, i32* %29, i64 %109
store i32 %107, i32* %110
br label %111
111: ; preds = %72
%112 = load i32, i32* %16
%113 = add nsw i32 %112, 1
store i32 %113, i32* %16
br label %68
114: ; preds = %68
%115 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %18, i64 0, i64 0
%116 = bitcast [3 x double]* %115 to double**
%117 = bitcast [3 x double]* %26 to double**
%118 = load i32, i32* %12
%119 = load i32, i32* %14
%120 = load i32, i32* %15
%121 = load double, double* %13
%122 = call i32 @spg_standardize_cell(double** %116, double** %117, i32* %29, i32 %118, i32 %119, i32 %120, double %121)
store i32 %122, i32* %17
%123 = load i32, i32* %17
%124 = icmp ne i32 %123, 0
br i1 %124, label %125, label %194
125: ; preds = %114
%126 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%127 = load i32, i32* %14
%128 = icmp eq i32 %127, 0
br i1 %128, label %129, label %131
129: ; preds = %125
%130 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
br label %133
131: ; preds = %125
%132 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
br label %133
133: ; preds = %131, %129
%134 = load i32, i32* %15
%135 = icmp eq i32 %134, 0
br i1 %135, label %136, label %138
136: ; preds = %133
%137 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0))
br label %140
138: ; preds = %133
%139 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0))
br label %140
140: ; preds = %138, %136
%141 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
store i32 0, i32* %16
br label %142
142: ; preds = %162, %140
%143 = load i32, i32* %16
%144 = icmp slt i32 %143, 3
br i1 %144, label %145, label %165
145: ; preds = %142
%146 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %18, i64 0, i64 0
%147 = load i32, i32* %16
%148 = sext i32 %147 to i64
%149 = getelementptr inbounds [3 x double], [3 x double]* %146, i64 0, i64 %148
%150 = load double, double* %149
%151 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %18, i64 0, i64 1
%152 = load i32, i32* %16
%153 = sext i32 %152 to i64
%154 = getelementptr inbounds [3 x double], [3 x double]* %151, i64 0, i64 %153
%155 = load double, double* %154
%156 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %18, i64 0, i64 2
%157 = load i32, i32* %16
%158 = sext i32 %157 to i64
%159 = getelementptr inbounds [3 x double], [3 x double]* %156, i64 0, i64 %158
%160 = load double, double* %159
%161 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0), double %150, double %155, double %160)
br label %162
162: ; preds = %145
%163 = load i32, i32* %16
%164 = add nsw i32 %163, 1
store i32 %164, i32* %16
br label %142
165: ; preds = %142
%166 = load i32, i32* %17
%167 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i32 %166)
%168 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0))
store i32 0, i32* %16
br label %169
169: ; preds = %190, %165
%170 = load i32, i32* %16
%171 = load i32, i32* %17
%172 = icmp slt i32 %170, %171
br i1 %172, label %173, label %193
173: ; preds = %169
%174 = load i32, i32* %16
%175 = sext i32 %174 to i64
%176 = getelementptr inbounds [3 x double], [3 x double]* %26, i64 %175
%177 = getelementptr inbounds [3 x double], [3 x double]* %176, i64 0, i64 0
%178 = load double, double* %177
%179 = load i32, i32* %16
%180 = sext i32 %179 to i64
%181 = getelementptr inbounds [3 x double], [3 x double]* %26, i64 %180
%182 = getelementptr inbounds [3 x double], [3 x double]* %181, i64 0, i64 1
%183 = load double, double* %182
%184 = load i32, i32* %16
%185 = sext i32 %184 to i64
%186 = getelementptr inbounds [3 x double], [3 x double]* %26, i64 %185
%187 = getelementptr inbounds [3 x double], [3 x double]* %186, i64 0, i64 2
%188 = load double, double* %187
%189 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0), double %178, double %183, double %188)
br label %190
190: ; preds = %173
%191 = load i32, i32* %16
%192 = add nsw i32 %191, 1
store i32 %192, i32* %16
br label %169
193: ; preds = %169
store i32 0, i32* %8
store i32 1, i32* %22
br label %195
194: ; preds = %114
store i32 1, i32* %8
store i32 1, i32* %22
br label %195
195: ; preds = %194, %193
%196 = load i8*, i8** %19
%197 = load i32, i32* %8
ret i32 %197
}

LLVM IR (-O2):
@.str = [21 x i8] c"VASP POSCAR format: \00"
@.str.1 = [20 x i8] c"to_primitive=0 and \00"
@.str.2 = [20 x i8] c"to_primitive=1 and \00"
@.str.6 = [10 x i8] c"%f %f %f\0A\00"
@.str.7 = [4 x i8] c"%d\0A\00"
@str = [14 x i8] c"no_idealize=1\00"
@str.9 = [4 x i8] c"1.0\00"
@str.10 = [7 x i8] c"Direct\00"
@str.11 = [14 x i8] c"no_idealize=0\00"
define i32 @sub_spg_standardize_cell([3 x double]* nocapture %0, [3 x double]* nocapture %1, i32* nocapture %2, i32 %3, double %4, i32 %5, i32 %6) {
%8 = alloca [3 x [3 x double]]
%9 = bitcast [3 x [3 x double]]* %8 to i8*
%10 = zext i32 %3 to i64
%11 = tail call i8* @llvm.stacksave()
%12 = alloca [3 x double], i64 %10
%13 = alloca i32, i64 %10
%14 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %8, i64 0, i64 0, i64 0
%15 = bitcast [3 x double]* %0 to <2 x double>*
%16 = load <2 x double>, <2 x double>* %15
%17 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %8, i64 0, i64 0, i64 1
%18 = bitcast [3 x [3 x double]]* %8 to <2 x double>*
store <2 x double> %16, <2 x double>* %18
%19 = getelementptr inbounds [3 x double], [3 x double]* %0, i64 0, i64 2
%20 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %8, i64 0, i64 0, i64 2
%21 = bitcast double* %19 to <2 x double>*
%22 = load <2 x double>, <2 x double>* %21
%23 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %8, i64 0, i64 1, i64 0
%24 = bitcast double* %20 to <2 x double>*
store <2 x double> %22, <2 x double>* %24
%25 = getelementptr inbounds [3 x double], [3 x double]* %0, i64 1, i64 1
%26 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %8, i64 0, i64 1, i64 1
%27 = bitcast double* %25 to <2 x double>*
%28 = load <2 x double>, <2 x double>* %27
%29 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %8, i64 0, i64 1, i64 2
%30 = bitcast double* %26 to <2 x double>*
store <2 x double> %28, <2 x double>* %30
%31 = getelementptr inbounds [3 x double], [3 x double]* %0, i64 2, i64 0
%32 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %8, i64 0, i64 2, i64 0
%33 = bitcast double* %31 to <2 x double>*
%34 = load <2 x double>, <2 x double>* %33
%35 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %8, i64 0, i64 2, i64 1
%36 = bitcast double* %32 to <2 x double>*
store <2 x double> %34, <2 x double>* %36
%37 = getelementptr inbounds [3 x double], [3 x double]* %0, i64 2, i64 2
%38 = load double, double* %37
%39 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %8, i64 0, i64 2, i64 2
store double %38, double* %39
%40 = icmp sgt i32 %3, 0
br i1 %40, label %41, label %84
41: ; preds = %7
%42 = bitcast i32* %13 to i8*
%43 = bitcast i32* %2 to i8*
%44 = shl nuw nsw i64 %10, 2
%45 = and i64 %10, 1
%46 = icmp eq i32 %3, 1
br i1 %46, label %72, label %47
47: ; preds = %41
%48 = and i64 %10, 4294967294
br label %49
49: ; preds = %49, %47
%50 = phi i64 [ 0, %47 ], [ %69, %49 ]
%51 = phi i64 [ 0, %47 ], [ %70, %49 ]
%52 = getelementptr inbounds [3 x double], [3 x double]* %1, i64 %50, i64 0
%53 = getelementptr inbounds [3 x double], [3 x double]* %12, i64 %50, i64 0
%54 = bitcast double* %52 to <2 x double>*
%55 = load <2 x double>, <2 x double>* %54
%56 = bitcast double* %53 to <2 x double>*
store <2 x double> %55, <2 x double>* %56
%57 = getelementptr inbounds [3 x double], [3 x double]* %1, i64 %50, i64 2
%58 = load double, double* %57
%59 = getelementptr inbounds [3 x double], [3 x double]* %12, i64 %50, i64 2
store double %58, double* %59
%60 = or i64 %50, 1
%61 = getelementptr inbounds [3 x double], [3 x double]* %1, i64 %60, i64 0
%62 = getelementptr inbounds [3 x double], [3 x double]* %12, i64 %60, i64 0
%63 = bitcast double* %61 to <2 x double>*
%64 = load <2 x double>, <2 x double>* %63
%65 = bitcast double* %62 to <2 x double>*
store <2 x double> %64, <2 x double>* %65
%66 = getelementptr inbounds [3 x double], [3 x double]* %1, i64 %60, i64 2
%67 = load double, double* %66
%68 = getelementptr inbounds [3 x double], [3 x double]* %12, i64 %60, i64 2
store double %67, double* %68
%69 = add nuw nsw i64 %50, 2
%70 = add i64 %51, 2
%71 = icmp eq i64 %70, %48
br i1 %71, label %72, label %49
72: ; preds = %49, %41
%73 = phi i64 [ 0, %41 ], [ %69, %49 ]
%74 = icmp eq i64 %45, 0
br i1 %74, label %84, label %75
75: ; preds = %72
%76 = getelementptr inbounds [3 x double], [3 x double]* %1, i64 %73, i64 0
%77 = getelementptr inbounds [3 x double], [3 x double]* %12, i64 %73, i64 0
%78 = bitcast double* %76 to <2 x double>*
%79 = load <2 x double>, <2 x double>* %78
%80 = bitcast double* %77 to <2 x double>*
store <2 x double> %79, <2 x double>* %80
%81 = getelementptr inbounds [3 x double], [3 x double]* %1, i64 %73, i64 2
%82 = load double, double* %81
%83 = getelementptr inbounds [3 x double], [3 x double]* %12, i64 %73, i64 2
store double %82, double* %83
br label %84
84: ; preds = %75, %72, %7
%85 = bitcast [3 x [3 x double]]* %8 to double**
%86 = bitcast [3 x double]* %12 to double**
%87 = call i32 @spg_standardize_cell(double** %85, double** %86, i32* %13, i32 %3, i32 %5, i32 %6, double %4)
%88 = icmp eq i32 %87, 0
br i1 %88, label %126, label %89
89: ; preds = %84
%90 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%91 = icmp eq i32 %5, 0
%92 = select i1 %91, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0)
%93 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %92)
%94 = icmp eq i32 %6, 0
%95 = select i1 %94, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @str.11, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0)
%96 = call i32 @puts(i8* dereferenceable(1) %95)
%97 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str.9, i64 0, i64 0))
%98 = load double, double* %14
%99 = load double, double* %23
%100 = load double, double* %32
%101 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0), double %98, double %99, double %100)
%102 = load double, double* %17
%103 = load double, double* %26
%104 = load double, double* %35
%105 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0), double %102, double %103, double %104)
%106 = load double, double* %20
%107 = load double, double* %29
%108 = load double, double* %39
%109 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0), double %106, double %107, double %108)
%110 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i32 %87)
%111 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.10, i64 0, i64 0))
%112 = icmp sgt i32 %87, 0
br i1 %112, label %113, label %126
113: ; preds = %89
%114 = zext i32 %87 to i64
br label %115
115: ; preds = %113, %115
%116 = phi i64 [ 0, %113 ], [ %124, %115 ]
%117 = getelementptr inbounds [3 x double], [3 x double]* %12, i64 %116, i64 0
%118 = load double, double* %117
%119 = getelementptr inbounds [3 x double], [3 x double]* %12, i64 %116, i64 1
%120 = load double, double* %119
%121 = getelementptr inbounds [3 x double], [3 x double]* %12, i64 %116, i64 2
%122 = load double, double* %121
%123 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0), double %118, double %120, double %122)
%124 = add nuw nsw i64 %116, 1
%125 = icmp eq i64 %124, %114
br i1 %125, label %126, label %115
126: ; preds = %115, %89, %84
%127 = phi i32 [ 1, %84 ], [ 0, %89 ], [ 0, %115 ]
ret i32 %127
}