#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*/ kgd_get_grid_address_double_mesh(int *, int const *,
                                                    int const *, int *);
int kgd_get_grid_point_double_mesh(int *, int const *);
int spg_get_grid_point_from_address(const int grid_address[3],
                                    const int mesh[3]) {
  int address_double[3];
  int is_shift[3];
  is_shift[0] = 0;
  is_shift[1] = 0;
  is_shift[2] = 0;
  kgd_get_grid_address_double_mesh(address_double, grid_address, mesh,
                                   is_shift);
  return kgd_get_grid_point_double_mesh(address_double, mesh);
}


x86 assembly (clang, -O0):
<spg_get_grid_point_from_address>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x28(%rbp)
movl   $0x0,-0x24(%rbp)
movl   $0x0,-0x20(%rbp)
lea    -0x1c(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    -0x28(%rbp),%rcx
call   1040 <kgd_get_grid_address_double_mesh@plt>
lea    -0x1c(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <kgd_get_grid_point_double_mesh@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<spg_get_grid_point_from_address>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%rbx
mov    %rdi,%rsi
movq   $0x0,(%rsp)
movl   $0x0,0x8(%rsp)
lea    0xc(%rsp),%r14
mov    %rsp,%rcx
mov    %r14,%rdi
mov    %rbx,%rdx
call   1040 <kgd_get_grid_address_double_mesh@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <kgd_get_grid_point_double_mesh@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @spg_get_grid_point_from_address(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca [3 x i32]
%6 = alloca [3 x i32]
store i32* %0, i32** %3
store i32* %1, i32** %4
%7 = getelementptr inbounds [3 x i32], [3 x i32]* %6, i64 0, i64 0
store i32 0, i32* %7
%8 = getelementptr inbounds [3 x i32], [3 x i32]* %6, i64 0, i64 1
store i32 0, i32* %8
%9 = getelementptr inbounds [3 x i32], [3 x i32]* %6, i64 0, i64 2
store i32 0, i32* %9
%10 = getelementptr inbounds [3 x i32], [3 x i32]* %5, i64 0, i64 0
%11 = load i32*, i32** %3
%12 = load i32*, i32** %4
%13 = getelementptr inbounds [3 x i32], [3 x i32]* %6, i64 0, i64 0
%14 = call i32 @kgd_get_grid_address_double_mesh(i32* %10, i32* %11, i32* %12, i32* %13)
%15 = getelementptr inbounds [3 x i32], [3 x i32]* %5, i64 0, i64 0
%16 = load i32*, i32** %4
%17 = call i32 @kgd_get_grid_point_double_mesh(i32* %15, i32* %16)
ret i32 %17
}

LLVM IR (-O2):
define i32 @spg_get_grid_point_from_address(i32* %0, i32* %1) {
%3 = alloca [3 x i32]
%4 = alloca [3 x i32]
%5 = bitcast [3 x i32]* %3 to i8*
%6 = bitcast [3 x i32]* %4 to i8*
%7 = getelementptr inbounds [3 x i32], [3 x i32]* %4, i64 0, i64 0
store i32 0, i32* %7
%8 = getelementptr inbounds [3 x i32], [3 x i32]* %4, i64 0, i64 1
store i32 0, i32* %8
%9 = getelementptr inbounds [3 x i32], [3 x i32]* %4, i64 0, i64 2
store i32 0, i32* %9
%10 = getelementptr inbounds [3 x i32], [3 x i32]* %3, i64 0, i64 0
%11 = call i32 @kgd_get_grid_address_double_mesh(i32* %10, i32* %0, i32* %1, i32* %7)
%12 = call i32 @kgd_get_grid_point_double_mesh(i32* %10, i32* %1)
ret i32 %12
}