#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 spg_get_ir_reciprocal_mesh(int **, int *, int *, int *, int, double **,
                               double **, int *, int, double);
void spg_get_ir_reciprocal_mesh_(int *num_ir_grid, int grid_point[][3],
                                 int map[], int mesh[3], int is_shift[3],
                                 int *is_time_reversal, double lattice[3][3],
                                 double position[][3], int types[],
                                 int *num_atom, double *symprec) {
  int i;
  *num_ir_grid = spg_get_ir_reciprocal_mesh(
      grid_point, map, mesh, is_shift, *is_time_reversal, lattice, position,
      types, *num_atom, *symprec);
  for (i = 0; i < mesh[0] * mesh[1] * mesh[2]; i++) {
    map[i]++;
  }
}


x86 assembly (clang, -O0):
<spg_get_ir_reciprocal_mesh_>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
sub    $0x58,%rsp
mov    0x30(%rbp),%rax
mov    0x28(%rbp),%rax
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
mov    %r9,-0x38(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    -0x30(%rbp),%rcx
mov    -0x38(%rbp),%rax
mov    (%rax),%r8d
mov    0x10(%rbp),%r9
mov    0x18(%rbp),%r11
mov    0x20(%rbp),%r10
mov    0x28(%rbp),%rax
mov    (%rax),%eax
mov    0x30(%rbp),%rbx
movsd  (%rbx),%xmm0
mov    %r11,(%rsp)
mov    %r10,0x8(%rsp)
mov    %eax,0x10(%rsp)
call   1030 <spg_get_ir_reciprocal_mesh@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x0,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
mov    -0x28(%rbp),%rcx
mov    (%rcx),%ecx
mov    -0x28(%rbp),%rdx
imul   0x4(%rdx),%ecx
mov    -0x28(%rbp),%rdx
imul   0x8(%rdx),%ecx
cmp    %ecx,%eax
jge    11d7 <spg_get_ir_reciprocal_mesh_+0xc7>
mov    -0x20(%rbp),%rax
movslq -0x3c(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
add    $0x1,%edx
mov    %edx,(%rax,%rcx,4)
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    1197 <spg_get_ir_reciprocal_mesh_+0x87>
add    $0x58,%rsp
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<spg_get_ir_reciprocal_mesh_>:
push   %r15
push   %r14
push   %rbx
sub    $0x20,%rsp
mov    %r8,%rax
mov    %rcx,%rbx
mov    %rdx,%r14
mov    %rdi,%r15
mov    0x40(%rsp),%r10
movups 0x48(%rsp),%xmm1
mov    0x60(%rsp),%rcx
mov    0x58(%rsp),%rdx
mov    (%r9),%r8d
mov    (%rdx),%edx
movsd  (%rcx),%xmm0
mov    %edx,0x10(%rsp)
movups %xmm1,(%rsp)
mov    %rsi,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
mov    %rax,%rcx
mov    %r10,%r9
call   1030 <spg_get_ir_reciprocal_mesh@plt>
mov    %eax,(%r15)
mov    0x4(%rbx),%eax
imul   (%rbx),%eax
imul   0x8(%rbx),%eax
test   %eax,%eax
jle    11a1 <spg_get_ir_reciprocal_mesh_+0x91>
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
addl   $0x1,(%r14,%rax,4)
add    $0x1,%rax
movslq (%rbx),%rcx
movslq 0x4(%rbx),%rdx
imul   %rcx,%rdx
movslq 0x8(%rbx),%rcx
imul   %rdx,%rcx
cmp    %rcx,%rax
jl     1180 <spg_get_ir_reciprocal_mesh_+0x70>
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @spg_get_ir_reciprocal_mesh_(i32* %0, [3 x i32]* %1, i32* %2, i32* %3, i32* %4, i32* %5, [3 x double]* %6, [3 x double]* %7, i32* %8, i32* %9, double* %10) {
%12 = alloca i32*
%13 = alloca [3 x i32]*
%14 = alloca i32*
%15 = alloca i32*
%16 = alloca i32*
%17 = alloca i32*
%18 = alloca [3 x double]*
%19 = alloca [3 x double]*
%20 = alloca i32*
%21 = alloca i32*
%22 = alloca double*
%23 = alloca i32
store i32* %0, i32** %12
store [3 x i32]* %1, [3 x i32]** %13
store i32* %2, i32** %14
store i32* %3, i32** %15
store i32* %4, i32** %16
store i32* %5, i32** %17
store [3 x double]* %6, [3 x double]** %18
store [3 x double]* %7, [3 x double]** %19
store i32* %8, i32** %20
store i32* %9, i32** %21
store double* %10, double** %22
%24 = load [3 x i32]*, [3 x i32]** %13
%25 = bitcast [3 x i32]* %24 to i32**
%26 = load i32*, i32** %14
%27 = load i32*, i32** %15
%28 = load i32*, i32** %16
%29 = load i32*, i32** %17
%30 = load i32, i32* %29
%31 = load [3 x double]*, [3 x double]** %18
%32 = bitcast [3 x double]* %31 to double**
%33 = load [3 x double]*, [3 x double]** %19
%34 = bitcast [3 x double]* %33 to double**
%35 = load i32*, i32** %20
%36 = load i32*, i32** %21
%37 = load i32, i32* %36
%38 = load double*, double** %22
%39 = load double, double* %38
%40 = call i32 @spg_get_ir_reciprocal_mesh(i32** %25, i32* %26, i32* %27, i32* %28, i32 %30, double** %32, double** %34, i32* %35, i32 %37, double %39)
%41 = load i32*, i32** %12
store i32 %40, i32* %41
store i32 0, i32* %23
br label %42
42: ; preds = %63, %11
%43 = load i32, i32* %23
%44 = load i32*, i32** %15
%45 = getelementptr inbounds i32, i32* %44, i64 0
%46 = load i32, i32* %45
%47 = load i32*, i32** %15
%48 = getelementptr inbounds i32, i32* %47, i64 1
%49 = load i32, i32* %48
%50 = mul nsw i32 %46, %49
%51 = load i32*, i32** %15
%52 = getelementptr inbounds i32, i32* %51, i64 2
%53 = load i32, i32* %52
%54 = mul nsw i32 %50, %53
%55 = icmp slt i32 %43, %54
br i1 %55, label %56, label %66
56: ; preds = %42
%57 = load i32*, i32** %14
%58 = load i32, i32* %23
%59 = sext i32 %58 to i64
%60 = getelementptr inbounds i32, i32* %57, i64 %59
%61 = load i32, i32* %60
%62 = add nsw i32 %61, 1
store i32 %62, i32* %60
br label %63
63: ; preds = %56
%64 = load i32, i32* %23
%65 = add nsw i32 %64, 1
store i32 %65, i32* %23
br label %42
66: ; preds = %42
ret void
}

LLVM IR (-O2):
define void @spg_get_ir_reciprocal_mesh_(i32* nocapture writeonly %0, [3 x i32]* %1, i32* %2, i32* %3, i32* %4, i32* nocapture %5, [3 x double]* %6, [3 x double]* %7, i32* %8, i32* nocapture %9, double* nocapture %10) {
%12 = bitcast [3 x i32]* %1 to i32**
%13 = load i32, i32* %5
%14 = bitcast [3 x double]* %6 to double**
%15 = bitcast [3 x double]* %7 to double**
%16 = load i32, i32* %9
%17 = load double, double* %10
%18 = tail call i32 @spg_get_ir_reciprocal_mesh(i32** %12, i32* %2, i32* %3, i32* %4, i32 %13, double** %14, double** %15, i32* %8, i32 %16, double %17)
store i32 %18, i32* %0
%19 = getelementptr inbounds i32, i32* %3, i64 1
%20 = getelementptr inbounds i32, i32* %3, i64 2
%21 = load i32, i32* %3
%22 = load i32, i32* %19
%23 = mul nsw i32 %22, %21
%24 = load i32, i32* %20
%25 = mul nsw i32 %23, %24
%26 = icmp sgt i32 %25, 0
br i1 %26, label %27, label %40
27: ; preds = %11, %27
%28 = phi i64 [ %32, %27 ], [ 0, %11 ]
%29 = getelementptr inbounds i32, i32* %2, i64 %28
%30 = load i32, i32* %29
%31 = add nsw i32 %30, 1
store i32 %31, i32* %29
%32 = add nuw nsw i64 %28, 1
%33 = load i32, i32* %3
%34 = load i32, i32* %19
%35 = mul nsw i32 %34, %33
%36 = load i32, i32* %20
%37 = mul nsw i32 %35, %36
%38 = sext i32 %37 to i64
%39 = icmp slt i64 %32, %38
br i1 %39, label %27, label %40
40: ; preds = %27, %11
ret void
}