#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 */
struct timeval {
  int tv_sec;
  scalar_t__ tv_usec;
};
struct option_t {
  int dummy;
};
struct GTOBasis_t {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ GTO_JK_Matrix(int, float *, struct GTOBasis_t *, float *,
                                 float, float *);
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, scalar_t__);
void uhf_getGMatrix(int nBasis, struct GTOBasis_t *gto, float *Schwarz,
                    float cutoff, float *PA, float *PB, float *GA, float *GB,
                    struct option_t *opt) {
  int i, j;
  struct timeval startTime;
  struct timeval endTime;
  gettimeofday(&startTime, NULL);
  for (i = 0; i < nBasis; i++)
    for (j = 0; j < nBasis; j++) {
      GA[i * nBasis + j] = 0.0;
      GB[i * nBasis + j] = 0.0;
    }
  GTO_JK_Matrix(nBasis, PA, gto, Schwarz, cutoff, GA);
  gettimeofday(&endTime, NULL);
  printf("getG cost time: %ld us.\n",
         1000000 * (endTime.tv_sec - startTime.tv_sec) + endTime.tv_usec -
             startTime.tv_usec);
  for (i = 0; i < nBasis; i++)
    for (j = 0; j < nBasis; j++) {
      GB[i * nBasis + j] = GA[i * nBasis + j];
    }
}


x86 assembly (clang, -O0):
<uhf_getGMatrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movss  %xmm0,-0x1c(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
mov    %r9,-0x38(%rbp)
lea    -0x50(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <gettimeofday@plt>
movl   $0x0,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    11e2 <uhf_getGMatrix+0xb2>
movl   $0x0,-0x40(%rbp)
mov    -0x40(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    11cf <uhf_getGMatrix+0x9f>
mov    -0x38(%rbp),%rax
mov    -0x3c(%rbp),%ecx
imul   -0x4(%rbp),%ecx
add    -0x40(%rbp),%ecx
movslq %ecx,%rcx
xorps  %xmm0,%xmm0
movss  %xmm0,(%rax,%rcx,4)
mov    0x10(%rbp),%rax
mov    -0x3c(%rbp),%ecx
imul   -0x4(%rbp),%ecx
add    -0x40(%rbp),%ecx
movslq %ecx,%rcx
xorps  %xmm0,%xmm0
movss  %xmm0,(%rax,%rcx,4)
mov    -0x40(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x40(%rbp)
jmp    1183 <uhf_getGMatrix+0x53>
jmp    11d4 <uhf_getGMatrix+0xa4>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    1170 <uhf_getGMatrix+0x40>
mov    -0x4(%rbp),%edi
mov    -0x28(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
movss  -0x1c(%rbp),%xmm0
mov    -0x38(%rbp),%r8
call   1050 <GTO_JK_Matrix@plt>
lea    -0x60(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <gettimeofday@plt>
mov    -0x60(%rbp),%eax
sub    -0x50(%rbp),%eax
imul   $0xf4240,%eax,%eax
movslq %eax,%rsi
add    -0x58(%rbp),%rsi
sub    -0x48(%rbp),%rsi
lea    0xdd6(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    12a2 <uhf_getGMatrix+0x172>
movl   $0x0,-0x40(%rbp)
mov    -0x40(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    128f <uhf_getGMatrix+0x15f>
mov    -0x38(%rbp),%rax
mov    -0x3c(%rbp),%ecx
imul   -0x4(%rbp),%ecx
add    -0x40(%rbp),%ecx
movslq %ecx,%rcx
movss  (%rax,%rcx,4),%xmm0
mov    0x10(%rbp),%rax
mov    -0x3c(%rbp),%ecx
imul   -0x4(%rbp),%ecx
add    -0x40(%rbp),%ecx
movslq %ecx,%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x40(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x40(%rbp)
jmp    1249 <uhf_getGMatrix+0x119>
jmp    1294 <uhf_getGMatrix+0x164>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    1236 <uhf_getGMatrix+0x106>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uhf_getGMatrix>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x78,%rsp
mov    %r9,%rbp
mov    %rcx,0x48(%rsp)
movss  %xmm0,0x3c(%rsp)
mov    %rdx,0x50(%rsp)
mov    %rsi,0x40(%rsp)
mov    %edi,%ebx
mov    0xb0(%rsp),%r14
lea    0x68(%rsp),%rdi
xor    %esi,%esi
call   1040 <gettimeofday@plt>
mov    %r14,%rax
mov    %ebx,%r14d
mov    %ebx,0x4(%rsp)
test   %ebx,%ebx
mov    %rbp,0x10(%rsp)
jle    1414 <uhf_getGMatrix+0x2e4>
mov    %r14d,%ecx
and    $0xfffffff8,%ecx
mov    %rcx,0x30(%rsp)
add    $0xfffffffffffffff8,%rcx
mov    %rcx,0x28(%rsp)
mov    %rcx,%rdx
shr    $0x3,%rdx
add    $0x1,%rdx
mov    %edx,%r10d
and    $0x3,%r10d
movabs $0x3ffffffffffffffc,%rcx
ff ff 3f
and    %rcx,%rdx
mov    %rdx,0x18(%rsp)
mov    %r14d,%edx
and    $0x3,%edx
lea    0x70(%rax),%rcx
lea    0x0(,%r14,4),%r8
lea    0x70(%rbp),%rsi
lea    0x10(%rax),%r13
lea    0x10(%rbp),%r15
mov    %r10,0x20(%rsp)
shl    $0x5,%r10
xor    %r9d,%r9d
xorps  %xmm0,%xmm0
mov    %rbp,%r12
mov    %rax,%rbx
mov    %rdx,%rax
mov    %rdx,0x8(%rsp)
jmp    121f <uhf_getGMatrix+0xef>
nopl   0x0(%rax,%rax,1)
add    $0x1,%r9
add    %r8,%rcx
add    %r8,%rsi
add    %r8,%r13
add    %r8,%r15
add    %r8,%rbx
add    %r8,%r12
cmp    %r14,%r9
je     1414 <uhf_getGMatrix+0x2e4>
cmpl   $0x8,0x4(%rsp)
jae    1230 <uhf_getGMatrix+0x100>
xor    %r11d,%r11d
jmp    1370 <uhf_getGMatrix+0x240>
xchg   %ax,%ax
mov    %r9,%rax
imul   %r14,%rax
lea    (%rax,%r14,1),%rdx
mov    0xb0(%rsp),%rdi
lea    (%rdi,%rdx,4),%rdi
mov    0x10(%rsp),%rbp
lea    0x0(%rbp,%rax,4),%rbp
cmp    %rdi,%rbp
mov    0xb0(%rsp),%rdi
mov    0x10(%rsp),%rbp
jae    1290 <uhf_getGMatrix+0x160>
lea    (%rdi,%rax,4),%rax
lea    0x0(,%rdx,4),%rdx
add    %rbp,%rdx
cmp    %rdx,%rax
jae    1290 <uhf_getGMatrix+0x160>
xor    %r11d,%r11d
mov    0x8(%rsp),%rax
jmp    1370 <uhf_getGMatrix+0x240>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
cmpq   $0x18,0x28(%rsp)
jae    129c <uhf_getGMatrix+0x16c>
xor    %edi,%edi
jmp    1308 <uhf_getGMatrix+0x1d8>
mov    0x18(%rsp),%rdx
xor    %edi,%edi
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movups %xmm0,-0x70(%rsi,%rdi,4)
movups %xmm0,-0x60(%rsi,%rdi,4)
movups %xmm0,-0x70(%rcx,%rdi,4)
movups %xmm0,-0x60(%rcx,%rdi,4)
movups %xmm0,-0x50(%rsi,%rdi,4)
movups %xmm0,-0x40(%rsi,%rdi,4)
movups %xmm0,-0x50(%rcx,%rdi,4)
movups %xmm0,-0x40(%rcx,%rdi,4)
movups %xmm0,-0x30(%rsi,%rdi,4)
movups %xmm0,-0x20(%rsi,%rdi,4)
movups %xmm0,-0x30(%rcx,%rdi,4)
movups %xmm0,-0x20(%rcx,%rdi,4)
movups %xmm0,-0x10(%rsi,%rdi,4)
movups %xmm0,(%rsi,%rdi,4)
movups %xmm0,-0x10(%rcx,%rdi,4)
movups %xmm0,(%rcx,%rdi,4)
add    $0x20,%rdi
add    $0xfffffffffffffffc,%rdx
jne    12b0 <uhf_getGMatrix+0x180>
cmpq   $0x0,0x20(%rsp)
je     134b <uhf_getGMatrix+0x21b>
lea    0x0(,%rdi,4),%rdx
add    %r13,%rdx
lea    (%r15,%rdi,4),%rdi
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movups %xmm0,-0x10(%rdi,%rax,1)
movups %xmm0,(%rdi,%rax,1)
movups %xmm0,-0x10(%rdx,%rax,1)
movups %xmm0,(%rdx,%rax,1)
add    $0x20,%rax
cmp    %rax,%r10
jne    1330 <uhf_getGMatrix+0x200>
mov    0x30(%rsp),%rax
mov    %rax,%r11
cmp    %r14,%rax
mov    0x8(%rsp),%rax
je     1200 <uhf_getGMatrix+0xd0>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r11,%rdx
not    %rdx
add    %r14,%rdx
test   %rax,%rax
je     13aa <uhf_getGMatrix+0x27a>
mov    %rax,%rdi
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movl   $0x0,(%r12,%r11,4)
movl   $0x0,(%rbx,%r11,4)
add    $0x1,%r11
add    $0xffffffffffffffff,%rdi
jne    1390 <uhf_getGMatrix+0x260>
cmp    $0x3,%rdx
jb     1200 <uhf_getGMatrix+0xd0>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movl   $0x0,(%r12,%r11,4)
movl   $0x0,(%rbx,%r11,4)
movl   $0x0,0x4(%r12,%r11,4)
movl   $0x0,0x4(%rbx,%r11,4)
movl   $0x0,0x8(%r12,%r11,4)
movl   $0x0,0x8(%rbx,%r11,4)
movl   $0x0,0xc(%r12,%r11,4)
movl   $0x0,0xc(%rbx,%r11,4)
add    $0x4,%r11
cmp    %r11,%r14
jne    13c0 <uhf_getGMatrix+0x290>
jmp    1200 <uhf_getGMatrix+0xd0>
mov    0x4(%rsp),%ebx
mov    %ebx,%edi
mov    0x48(%rsp),%rsi
mov    0x40(%rsp),%rdx
mov    0x50(%rsp),%rcx
movss  0x3c(%rsp),%xmm0
mov    %rbp,%r8
call   1050 <GTO_JK_Matrix@plt>
lea    0x58(%rsp),%rdi
xor    %esi,%esi
call   1040 <gettimeofday@plt>
movslq 0x58(%rsp),%rax
movslq 0x68(%rsp),%rcx
sub    %rcx,%rax
imul   $0xf4240,%rax,%rax
mov    0x60(%rsp),%rsi
sub    0x70(%rsp),%rsi
add    %rax,%rsi
lea    0xb95(%rip),%rdi
call   1030 <printf@plt>
mov    0xb0(%rsp),%r8
test   %ebx,%ebx
jle    16d5 <uhf_getGMatrix+0x5a5>
mov    %r14d,%eax
and    $0xfffffff8,%eax
mov    %rax,0x30(%rsp)
add    $0xfffffffffffffff8,%rax
mov    %rax,0x28(%rsp)
mov    %rax,%rcx
shr    $0x3,%rcx
add    $0x1,%rcx
mov    %ecx,%r12d
and    $0x3,%r12d
movabs $0x3ffffffffffffffc,%rax
ff ff 3f
and    %rax,%rcx
mov    %rcx,0x18(%rsp)
mov    %r14d,%edi
and    $0x3,%edi
lea    0x70(%r8),%rcx
lea    0x0(,%r14,4),%r10
mov    0x10(%rsp),%rbp
lea    0x70(%rbp),%rsi
lea    0x10(%r8),%r9
lea    0x10(%rbp),%r13
mov    %r12,0x20(%rsp)
shl    $0x5,%r12
xor    %r15d,%r15d
mov    %rdi,0x8(%rsp)
jmp    150f <uhf_getGMatrix+0x3df>
xchg   %ax,%ax
add    $0x1,%r15
add    %r10,%rcx
add    %r10,%rsi
add    %r10,%r9
add    %r10,%r13
add    %r10,%r8
add    %r10,%rbp
cmp    %r14,%r15
je     16d5 <uhf_getGMatrix+0x5a5>
cmpl   $0x8,0x4(%rsp)
jae    1520 <uhf_getGMatrix+0x3f0>
xor    %r11d,%r11d
jmp    1640 <uhf_getGMatrix+0x510>
xchg   %ax,%ax
mov    %r15,%rax
imul   %r14,%rax
lea    (%rax,%r14,1),%rdx
mov    0x10(%rsp),%rbx
lea    (%rbx,%rdx,4),%r11
mov    0xb0(%rsp),%rdi
lea    (%rdi,%rax,4),%rdi
cmp    %r11,%rdi
mov    0xb0(%rsp),%rdi
jae    1570 <uhf_getGMatrix+0x440>
lea    (%rbx,%rax,4),%rax
lea    (%rdi,%rdx,4),%rdx
cmp    %rdx,%rax
jae    1570 <uhf_getGMatrix+0x440>
xor    %r11d,%r11d
mov    0x8(%rsp),%rdi
jmp    1640 <uhf_getGMatrix+0x510>
nopw   0x0(%rax,%rax,1)
cmpq   $0x18,0x28(%rsp)
jae    157c <uhf_getGMatrix+0x44c>
xor    %edx,%edx
jmp    15e8 <uhf_getGMatrix+0x4b8>
mov    0x18(%rsp),%rax
xor    %edx,%edx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movups -0x70(%rsi,%rdx,4),%xmm0
movups -0x60(%rsi,%rdx,4),%xmm1
movups %xmm0,-0x70(%rcx,%rdx,4)
movups %xmm1,-0x60(%rcx,%rdx,4)
movups -0x50(%rsi,%rdx,4),%xmm0
movups -0x40(%rsi,%rdx,4),%xmm1
movups %xmm0,-0x50(%rcx,%rdx,4)
movups %xmm1,-0x40(%rcx,%rdx,4)
movups -0x30(%rsi,%rdx,4),%xmm0
movups -0x20(%rsi,%rdx,4),%xmm1
movups %xmm0,-0x30(%rcx,%rdx,4)
movups %xmm1,-0x20(%rcx,%rdx,4)
movups -0x10(%rsi,%rdx,4),%xmm0
movups (%rsi,%rdx,4),%xmm1
movups %xmm0,-0x10(%rcx,%rdx,4)
movups %xmm1,(%rcx,%rdx,4)
add    $0x20,%rdx
add    $0xfffffffffffffffc,%rax
jne    1590 <uhf_getGMatrix+0x460>
cmpq   $0x0,0x20(%rsp)
mov    0x8(%rsp),%rdi
je     162b <uhf_getGMatrix+0x4fb>
lea    (%r9,%rdx,4),%rax
lea    0x0(,%rdx,4),%rdx
add    %r13,%rdx
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
movups -0x10(%rdx,%rbx,1),%xmm0
movups (%rdx,%rbx,1),%xmm1
movups %xmm0,-0x10(%rax,%rbx,1)
movups %xmm1,(%rax,%rbx,1)
add    $0x20,%rbx
cmp    %rbx,%r12
jne    1610 <uhf_getGMatrix+0x4e0>
mov    0x30(%rsp),%rax
mov    %rax,%r11
cmp    %r14,%rax
je     14f0 <uhf_getGMatrix+0x3c0>
nopl   0x0(%rax)
mov    %r11,%rax
not    %rax
add    %r14,%rax
test   %rdi,%rdi
je     1677 <uhf_getGMatrix+0x547>
mov    %rdi,%rdx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movss  0x0(%rbp,%r11,4),%xmm0
movss  %xmm0,(%r8,%r11,4)
add    $0x1,%r11
add    $0xffffffffffffffff,%rdx
jne    1660 <uhf_getGMatrix+0x530>
cmp    $0x3,%rax
jb     14f0 <uhf_getGMatrix+0x3c0>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movss  0x0(%rbp,%r11,4),%xmm0
movss  %xmm0,(%r8,%r11,4)
movss  0x4(%rbp,%r11,4),%xmm0
movss  %xmm0,0x4(%r8,%r11,4)
movss  0x8(%rbp,%r11,4),%xmm0
movss  %xmm0,0x8(%r8,%r11,4)
movss  0xc(%rbp,%r11,4),%xmm0
movss  %xmm0,0xc(%r8,%r11,4)
add    $0x4,%r11
cmp    %r11,%r14
jne    1690 <uhf_getGMatrix+0x560>
jmp    14f0 <uhf_getGMatrix+0x3c0>
add    $0x78,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.GTOBasis_t = type { i32 }
%struct.option_t = type { i32 }
%struct.timeval = type { i32, i64 }
@.str = [25 x i8] c"getG cost time: %ld us.\0A\00"
define void @uhf_getGMatrix(i32 %0, %struct.GTOBasis_t* %1, float* %2, float %3, float* %4, float* %5, float* %6, float* %7, %struct.option_t* %8) {
%10 = alloca i32
%11 = alloca %struct.GTOBasis_t*
%12 = alloca float*
%13 = alloca float
%14 = alloca float*
%15 = alloca float*
%16 = alloca float*
%17 = alloca float*
%18 = alloca %struct.option_t*
%19 = alloca i32
%20 = alloca i32
%21 = alloca %struct.timeval
%22 = alloca %struct.timeval
store i32 %0, i32* %10
store %struct.GTOBasis_t* %1, %struct.GTOBasis_t** %11
store float* %2, float** %12
store float %3, float* %13
store float* %4, float** %14
store float* %5, float** %15
store float* %6, float** %16
store float* %7, float** %17
store %struct.option_t* %8, %struct.option_t** %18
%23 = call i32 @gettimeofday(%struct.timeval* %21, i32* null)
store i32 0, i32* %19
br label %24
24: ; preds = %54, %9
%25 = load i32, i32* %19
%26 = load i32, i32* %10
%27 = icmp slt i32 %25, %26
br i1 %27, label %28, label %57
28: ; preds = %24
store i32 0, i32* %20
br label %29
29: ; preds = %50, %28
%30 = load i32, i32* %20
%31 = load i32, i32* %10
%32 = icmp slt i32 %30, %31
br i1 %32, label %33, label %53
33: ; preds = %29
%34 = load float*, float** %16
%35 = load i32, i32* %19
%36 = load i32, i32* %10
%37 = mul nsw i32 %35, %36
%38 = load i32, i32* %20
%39 = add nsw i32 %37, %38
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds float, float* %34, i64 %40
store float 0.000000e+00, float* %41
%42 = load float*, float** %17
%43 = load i32, i32* %19
%44 = load i32, i32* %10
%45 = mul nsw i32 %43, %44
%46 = load i32, i32* %20
%47 = add nsw i32 %45, %46
%48 = sext i32 %47 to i64
%49 = getelementptr inbounds float, float* %42, i64 %48
store float 0.000000e+00, float* %49
br label %50
50: ; preds = %33
%51 = load i32, i32* %20
%52 = add nsw i32 %51, 1
store i32 %52, i32* %20
br label %29
53: ; preds = %29
br label %54
54: ; preds = %53
%55 = load i32, i32* %19
%56 = add nsw i32 %55, 1
store i32 %56, i32* %19
br label %24
57: ; preds = %24
%58 = load i32, i32* %10
%59 = load float*, float** %14
%60 = load %struct.GTOBasis_t*, %struct.GTOBasis_t** %11
%61 = load float*, float** %12
%62 = load float, float* %13
%63 = load float*, float** %16
%64 = call i32 @GTO_JK_Matrix(i32 %58, float* %59, %struct.GTOBasis_t* %60, float* %61, float %62, float* %63)
%65 = call i32 @gettimeofday(%struct.timeval* %22, i32* null)
%66 = getelementptr inbounds %struct.timeval, %struct.timeval* %22, i32 0, i32 0
%67 = load i32, i32* %66
%68 = getelementptr inbounds %struct.timeval, %struct.timeval* %21, i32 0, i32 0
%69 = load i32, i32* %68
%70 = sub nsw i32 %67, %69
%71 = mul nsw i32 1000000, %70
%72 = sext i32 %71 to i64
%73 = getelementptr inbounds %struct.timeval, %struct.timeval* %22, i32 0, i32 1
%74 = load i64, i64* %73
%75 = add nsw i64 %72, %74
%76 = getelementptr inbounds %struct.timeval, %struct.timeval* %21, i32 0, i32 1
%77 = load i64, i64* %76
%78 = sub nsw i64 %75, %77
%79 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i64 %78)
store i32 0, i32* %19
br label %80
80: ; preds = %111, %57
%81 = load i32, i32* %19
%82 = load i32, i32* %10
%83 = icmp slt i32 %81, %82
br i1 %83, label %84, label %114
84: ; preds = %80
store i32 0, i32* %20
br label %85
85: ; preds = %107, %84
%86 = load i32, i32* %20
%87 = load i32, i32* %10
%88 = icmp slt i32 %86, %87
br i1 %88, label %89, label %110
89: ; preds = %85
%90 = load float*, float** %16
%91 = load i32, i32* %19
%92 = load i32, i32* %10
%93 = mul nsw i32 %91, %92
%94 = load i32, i32* %20
%95 = add nsw i32 %93, %94
%96 = sext i32 %95 to i64
%97 = getelementptr inbounds float, float* %90, i64 %96
%98 = load float, float* %97
%99 = load float*, float** %17
%100 = load i32, i32* %19
%101 = load i32, i32* %10
%102 = mul nsw i32 %100, %101
%103 = load i32, i32* %20
%104 = add nsw i32 %102, %103
%105 = sext i32 %104 to i64
%106 = getelementptr inbounds float, float* %99, i64 %105
store float %98, float* %106
br label %107
107: ; preds = %89
%108 = load i32, i32* %20
%109 = add nsw i32 %108, 1
store i32 %109, i32* %20
br label %85
110: ; preds = %85
br label %111
111: ; preds = %110
%112 = load i32, i32* %19
%113 = add nsw i32 %112, 1
store i32 %113, i32* %19
br label %80
114: ; preds = %80
ret void
}

LLVM IR (-O2):
%struct.GTOBasis_t = type { i32 }
%struct.option_t = type { i32 }
%struct.timeval = type { i32, i64 }
@.str = [25 x i8] c"getG cost time: %ld us.\0A\00"
define void @uhf_getGMatrix(i32 %0, %struct.GTOBasis_t* %1, float* %2, float %3, float* %4, float* nocapture readnone %5, float* %6, float* nocapture writeonly %7, %struct.option_t* nocapture readnone %8) {
%10 = alloca %struct.timeval
%11 = alloca %struct.timeval
%12 = bitcast %struct.timeval* %10 to i8*
%13 = bitcast %struct.timeval* %11 to i8*
%14 = call i32 @gettimeofday(%struct.timeval* %10, i32* null)
%15 = icmp sgt i32 %0, 0
br i1 %15, label %16, label %147
16: ; preds = %9
%17 = zext i32 %0 to i64
%18 = zext i32 %0 to i64
%19 = and i64 %18, 4294967288
%20 = add nsw i64 %19, -8
%21 = lshr exact i64 %20, 3
%22 = add nuw nsw i64 %21, 1
%23 = icmp ult i32 %0, 8
%24 = and i64 %18, 4294967288
%25 = and i64 %22, 3
%26 = icmp ult i64 %20, 24
%27 = and i64 %22, 4611686018427387900
%28 = icmp eq i64 %25, 0
%29 = icmp eq i64 %24, %18
%30 = and i64 %18, 3
%31 = icmp eq i64 %30, 0
br label %32
32: ; preds = %144, %16
%33 = phi i64 [ 0, %16 ], [ %145, %144 ]
%34 = mul i64 %33, %18
%35 = add i64 %34, %18
%36 = mul nsw i64 %33, %17
br i1 %23, label %109, label %37
37: ; preds = %32
%38 = getelementptr float, float* %7, i64 %35
%39 = getelementptr float, float* %7, i64 %34
%40 = getelementptr float, float* %6, i64 %35
%41 = getelementptr float, float* %6, i64 %34
%42 = icmp ult float* %41, %38
%43 = icmp ult float* %39, %40
%44 = and i1 %42, %43
br i1 %44, label %109, label %45
45: ; preds = %37
br i1 %26, label %91, label %46
46: ; preds = %45, %46
%47 = phi i64 [ %88, %46 ], [ 0, %45 ]
%48 = phi i64 [ %89, %46 ], [ 0, %45 ]
%49 = add nuw nsw i64 %47, %36
%50 = getelementptr inbounds float, float* %6, i64 %49
%51 = bitcast float* %50 to <4 x float>*
store <4 x float> zeroinitializer, <4 x float>* %51
%52 = getelementptr inbounds float, float* %50, i64 4
%53 = bitcast float* %52 to <4 x float>*
store <4 x float> zeroinitializer, <4 x float>* %53
%54 = getelementptr inbounds float, float* %7, i64 %49
%55 = bitcast float* %54 to <4 x float>*
store <4 x float> zeroinitializer, <4 x float>* %55
%56 = getelementptr inbounds float, float* %54, i64 4
%57 = bitcast float* %56 to <4 x float>*
store <4 x float> zeroinitializer, <4 x float>* %57
%58 = or i64 %47, 8
%59 = add nuw nsw i64 %58, %36
%60 = getelementptr inbounds float, float* %6, i64 %59
%61 = bitcast float* %60 to <4 x float>*
store <4 x float> zeroinitializer, <4 x float>* %61
%62 = getelementptr inbounds float, float* %60, i64 4
%63 = bitcast float* %62 to <4 x float>*
store <4 x float> zeroinitializer, <4 x float>* %63
%64 = getelementptr inbounds float, float* %7, i64 %59
%65 = bitcast float* %64 to <4 x float>*
store <4 x float> zeroinitializer, <4 x float>* %65
%66 = getelementptr inbounds float, float* %64, i64 4
%67 = bitcast float* %66 to <4 x float>*
store <4 x float> zeroinitializer, <4 x float>* %67
%68 = or i64 %47, 16
%69 = add nuw nsw i64 %68, %36
%70 = getelementptr inbounds float, float* %6, i64 %69
%71 = bitcast float* %70 to <4 x float>*
store <4 x float> zeroinitializer, <4 x float>* %71
%72 = getelementptr inbounds float, float* %70, i64 4
%73 = bitcast float* %72 to <4 x float>*
store <4 x float> zeroinitializer, <4 x float>* %73
%74 = getelementptr inbounds float, float* %7, i64 %69
%75 = bitcast float* %74 to <4 x float>*
store <4 x float> zeroinitializer, <4 x float>* %75
%76 = getelementptr inbounds float, float* %74, i64 4
%77 = bitcast float* %76 to <4 x float>*
store <4 x float> zeroinitializer, <4 x float>* %77
%78 = or i64 %47, 24
%79 = add nuw nsw i64 %78, %36
%80 = getelementptr inbounds float, float* %6, i64 %79
%81 = bitcast float* %80 to <4 x float>*
store <4 x float> zeroinitializer, <4 x float>* %81
%82 = getelementptr inbounds float, float* %80, i64 4
%83 = bitcast float* %82 to <4 x float>*
store <4 x float> zeroinitializer, <4 x float>* %83
%84 = getelementptr inbounds float, float* %7, i64 %79
%85 = bitcast float* %84 to <4 x float>*
store <4 x float> zeroinitializer, <4 x float>* %85
%86 = getelementptr inbounds float, float* %84, i64 4
%87 = bitcast float* %86 to <4 x float>*
store <4 x float> zeroinitializer, <4 x float>* %87
%88 = add nuw i64 %47, 32
%89 = add i64 %48, 4
%90 = icmp eq i64 %89, %27
br i1 %90, label %91, label %46
91: ; preds = %46, %45
%92 = phi i64 [ 0, %45 ], [ %88, %46 ]
br i1 %28, label %108, label %93
93: ; preds = %91, %93
%94 = phi i64 [ %105, %93 ], [ %92, %91 ]
%95 = phi i64 [ %106, %93 ], [ 0, %91 ]
%96 = add nuw nsw i64 %94, %36
%97 = getelementptr inbounds float, float* %6, i64 %96
%98 = bitcast float* %97 to <4 x float>*
store <4 x float> zeroinitializer, <4 x float>* %98
%99 = getelementptr inbounds float, float* %97, i64 4
%100 = bitcast float* %99 to <4 x float>*
store <4 x float> zeroinitializer, <4 x float>* %100
%101 = getelementptr inbounds float, float* %7, i64 %96
%102 = bitcast float* %101 to <4 x float>*
store <4 x float> zeroinitializer, <4 x float>* %102
%103 = getelementptr inbounds float, float* %101, i64 4
%104 = bitcast float* %103 to <4 x float>*
store <4 x float> zeroinitializer, <4 x float>* %104
%105 = add nuw i64 %94, 8
%106 = add i64 %95, 1
%107 = icmp eq i64 %106, %25
br i1 %107, label %108, label %93
108: ; preds = %93, %91
br i1 %29, label %144, label %109
109: ; preds = %37, %32, %108
%110 = phi i64 [ 0, %37 ], [ 0, %32 ], [ %24, %108 ]
%111 = xor i64 %110, -1
%112 = add nsw i64 %111, %18
br i1 %31, label %122, label %113
113: ; preds = %109, %113
%114 = phi i64 [ %119, %113 ], [ %110, %109 ]
%115 = phi i64 [ %120, %113 ], [ 0, %109 ]
%116 = add nuw nsw i64 %114, %36
%117 = getelementptr inbounds float, float* %6, i64 %116
store float 0.000000e+00, float* %117
%118 = getelementptr inbounds float, float* %7, i64 %116
store float 0.000000e+00, float* %118
%119 = add nuw nsw i64 %114, 1
%120 = add i64 %115, 1
%121 = icmp eq i64 %120, %30
br i1 %121, label %122, label %113
122: ; preds = %113, %109
%123 = phi i64 [ %110, %109 ], [ %119, %113 ]
%124 = icmp ult i64 %112, 3
br i1 %124, label %144, label %125
125: ; preds = %122, %125
%126 = phi i64 [ %142, %125 ], [ %123, %122 ]
%127 = add nuw nsw i64 %126, %36
%128 = getelementptr inbounds float, float* %6, i64 %127
store float 0.000000e+00, float* %128
%129 = getelementptr inbounds float, float* %7, i64 %127
store float 0.000000e+00, float* %129
%130 = add nuw nsw i64 %126, 1
%131 = add nuw nsw i64 %130, %36
%132 = getelementptr inbounds float, float* %6, i64 %131
store float 0.000000e+00, float* %132
%133 = getelementptr inbounds float, float* %7, i64 %131
store float 0.000000e+00, float* %133
%134 = add nuw nsw i64 %126, 2
%135 = add nuw nsw i64 %134, %36
%136 = getelementptr inbounds float, float* %6, i64 %135
store float 0.000000e+00, float* %136
%137 = getelementptr inbounds float, float* %7, i64 %135
store float 0.000000e+00, float* %137
%138 = add nuw nsw i64 %126, 3
%139 = add nuw nsw i64 %138, %36
%140 = getelementptr inbounds float, float* %6, i64 %139
store float 0.000000e+00, float* %140
%141 = getelementptr inbounds float, float* %7, i64 %139
store float 0.000000e+00, float* %141
%142 = add nuw nsw i64 %126, 4
%143 = icmp eq i64 %142, %18
br i1 %143, label %144, label %125
144: ; preds = %122, %125, %108
%145 = add nuw nsw i64 %33, 1
%146 = icmp eq i64 %145, %18
br i1 %146, label %147, label %32
147: ; preds = %144, %9
%148 = tail call i32 @GTO_JK_Matrix(i32 %0, float* %4, %struct.GTOBasis_t* %1, float* %2, float %3, float* %6)
%149 = call i32 @gettimeofday(%struct.timeval* %11, i32* null)
%150 = getelementptr inbounds %struct.timeval, %struct.timeval* %11, i64 0, i32 0
%151 = load i32, i32* %150
%152 = getelementptr inbounds %struct.timeval, %struct.timeval* %10, i64 0, i32 0
%153 = load i32, i32* %152
%154 = sub nsw i32 %151, %153
%155 = mul nsw i32 %154, 1000000
%156 = sext i32 %155 to i64
%157 = getelementptr inbounds %struct.timeval, %struct.timeval* %11, i64 0, i32 1
%158 = load i64, i64* %157
%159 = getelementptr inbounds %struct.timeval, %struct.timeval* %10, i64 0, i32 1
%160 = load i64, i64* %159
%161 = sub i64 %158, %160
%162 = add i64 %161, %156
%163 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i64 %162)
br i1 %15, label %164, label %310
164: ; preds = %147
%165 = zext i32 %0 to i64
%166 = zext i32 %0 to i64
%167 = and i64 %166, 4294967288
%168 = add nsw i64 %167, -8
%169 = lshr exact i64 %168, 3
%170 = add nuw nsw i64 %169, 1
%171 = icmp ult i32 %0, 8
%172 = and i64 %166, 4294967288
%173 = and i64 %170, 3
%174 = icmp ult i64 %168, 24
%175 = and i64 %170, 4611686018427387900
%176 = icmp eq i64 %173, 0
%177 = icmp eq i64 %172, %166
%178 = and i64 %166, 3
%179 = icmp eq i64 %178, 0
br label %180
180: ; preds = %307, %164
%181 = phi i64 [ 0, %164 ], [ %308, %307 ]
%182 = mul i64 %181, %166
%183 = add i64 %182, %166
%184 = mul nsw i64 %181, %165
br i1 %171, label %267, label %185
185: ; preds = %180
%186 = getelementptr float, float* %6, i64 %183
%187 = getelementptr float, float* %6, i64 %182
%188 = getelementptr float, float* %7, i64 %183
%189 = getelementptr float, float* %7, i64 %182
%190 = icmp ult float* %189, %186
%191 = icmp ult float* %187, %188
%192 = and i1 %190, %191
br i1 %192, label %267, label %193
193: ; preds = %185
br i1 %174, label %247, label %194
194: ; preds = %193, %194
%195 = phi i64 [ %244, %194 ], [ 0, %193 ]
%196 = phi i64 [ %245, %194 ], [ 0, %193 ]
%197 = add nuw nsw i64 %195, %184
%198 = getelementptr inbounds float, float* %6, i64 %197
%199 = bitcast float* %198 to <4 x float>*
%200 = load <4 x float>, <4 x float>* %199
%201 = getelementptr inbounds float, float* %198, i64 4
%202 = bitcast float* %201 to <4 x float>*
%203 = load <4 x float>, <4 x float>* %202
%204 = getelementptr inbounds float, float* %7, i64 %197
%205 = bitcast float* %204 to <4 x float>*
store <4 x float> %200, <4 x float>* %205
%206 = getelementptr inbounds float, float* %204, i64 4
%207 = bitcast float* %206 to <4 x float>*
store <4 x float> %203, <4 x float>* %207
%208 = or i64 %195, 8
%209 = add nuw nsw i64 %208, %184
%210 = getelementptr inbounds float, float* %6, i64 %209
%211 = bitcast float* %210 to <4 x float>*
%212 = load <4 x float>, <4 x float>* %211
%213 = getelementptr inbounds float, float* %210, i64 4
%214 = bitcast float* %213 to <4 x float>*
%215 = load <4 x float>, <4 x float>* %214
%216 = getelementptr inbounds float, float* %7, i64 %209
%217 = bitcast float* %216 to <4 x float>*
store <4 x float> %212, <4 x float>* %217
%218 = getelementptr inbounds float, float* %216, i64 4
%219 = bitcast float* %218 to <4 x float>*
store <4 x float> %215, <4 x float>* %219
%220 = or i64 %195, 16
%221 = add nuw nsw i64 %220, %184
%222 = getelementptr inbounds float, float* %6, i64 %221
%223 = bitcast float* %222 to <4 x float>*
%224 = load <4 x float>, <4 x float>* %223
%225 = getelementptr inbounds float, float* %222, i64 4
%226 = bitcast float* %225 to <4 x float>*
%227 = load <4 x float>, <4 x float>* %226
%228 = getelementptr inbounds float, float* %7, i64 %221
%229 = bitcast float* %228 to <4 x float>*
store <4 x float> %224, <4 x float>* %229
%230 = getelementptr inbounds float, float* %228, i64 4
%231 = bitcast float* %230 to <4 x float>*
store <4 x float> %227, <4 x float>* %231
%232 = or i64 %195, 24
%233 = add nuw nsw i64 %232, %184
%234 = getelementptr inbounds float, float* %6, i64 %233
%235 = bitcast float* %234 to <4 x float>*
%236 = load <4 x float>, <4 x float>* %235
%237 = getelementptr inbounds float, float* %234, i64 4
%238 = bitcast float* %237 to <4 x float>*
%239 = load <4 x float>, <4 x float>* %238
%240 = getelementptr inbounds float, float* %7, i64 %233
%241 = bitcast float* %240 to <4 x float>*
store <4 x float> %236, <4 x float>* %241
%242 = getelementptr inbounds float, float* %240, i64 4
%243 = bitcast float* %242 to <4 x float>*
store <4 x float> %239, <4 x float>* %243
%244 = add nuw i64 %195, 32
%245 = add i64 %196, 4
%246 = icmp eq i64 %245, %175
br i1 %246, label %247, label %194
247: ; preds = %194, %193
%248 = phi i64 [ 0, %193 ], [ %244, %194 ]
br i1 %176, label %266, label %249
249: ; preds = %247, %249
%250 = phi i64 [ %263, %249 ], [ %248, %247 ]
%251 = phi i64 [ %264, %249 ], [ 0, %247 ]
%252 = add nuw nsw i64 %250, %184
%253 = getelementptr inbounds float, float* %6, i64 %252
%254 = bitcast float* %253 to <4 x float>*
%255 = load <4 x float>, <4 x float>* %254
%256 = getelementptr inbounds float, float* %253, i64 4
%257 = bitcast float* %256 to <4 x float>*
%258 = load <4 x float>, <4 x float>* %257
%259 = getelementptr inbounds float, float* %7, i64 %252
%260 = bitcast float* %259 to <4 x float>*
store <4 x float> %255, <4 x float>* %260
%261 = getelementptr inbounds float, float* %259, i64 4
%262 = bitcast float* %261 to <4 x float>*
store <4 x float> %258, <4 x float>* %262
%263 = add nuw i64 %250, 8
%264 = add i64 %251, 1
%265 = icmp eq i64 %264, %173
br i1 %265, label %266, label %249
266: ; preds = %249, %247
br i1 %177, label %307, label %267
267: ; preds = %185, %180, %266
%268 = phi i64 [ 0, %185 ], [ 0, %180 ], [ %172, %266 ]
%269 = xor i64 %268, -1
%270 = add nsw i64 %269, %166
br i1 %179, label %281, label %271
271: ; preds = %267, %271
%272 = phi i64 [ %278, %271 ], [ %268, %267 ]
%273 = phi i64 [ %279, %271 ], [ 0, %267 ]
%274 = add nuw nsw i64 %272, %184
%275 = getelementptr inbounds float, float* %6, i64 %274
%276 = load float, float* %275
%277 = getelementptr inbounds float, float* %7, i64 %274
store float %276, float* %277
%278 = add nuw nsw i64 %272, 1
%279 = add i64 %273, 1
%280 = icmp eq i64 %279, %178
br i1 %280, label %281, label %271
281: ; preds = %271, %267
%282 = phi i64 [ %268, %267 ], [ %278, %271 ]
%283 = icmp ult i64 %270, 3
br i1 %283, label %307, label %284
284: ; preds = %281, %284
%285 = phi i64 [ %305, %284 ], [ %282, %281 ]
%286 = add nuw nsw i64 %285, %184
%287 = getelementptr inbounds float, float* %6, i64 %286
%288 = load float, float* %287
%289 = getelementptr inbounds float, float* %7, i64 %286
store float %288, float* %289
%290 = add nuw nsw i64 %285, 1
%291 = add nuw nsw i64 %290, %184
%292 = getelementptr inbounds float, float* %6, i64 %291
%293 = load float, float* %292
%294 = getelementptr inbounds float, float* %7, i64 %291
store float %293, float* %294
%295 = add nuw nsw i64 %285, 2
%296 = add nuw nsw i64 %295, %184
%297 = getelementptr inbounds float, float* %6, i64 %296
%298 = load float, float* %297
%299 = getelementptr inbounds float, float* %7, i64 %296
store float %298, float* %299
%300 = add nuw nsw i64 %285, 3
%301 = add nuw nsw i64 %300, %184
%302 = getelementptr inbounds float, float* %6, i64 %301
%303 = load float, float* %302
%304 = getelementptr inbounds float, float* %7, i64 %301
store float %303, float* %304
%305 = add nuw nsw i64 %285, 4
%306 = icmp eq i64 %305, %166
br i1 %306, label %307, label %284
307: ; preds = %281, %284, %266
%308 = add nuw nsw i64 %181, 1
%309 = icmp eq i64 %308, %166
br i1 %309, label %310, label %180
310: ; preds = %307, %147
ret void
}