#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 gengrid(int, int, int, int, int, int, int);
int /*<<< orphan*/ genindexbox(int /*<<< orphan*/, int, int *, int *, int *,
                               int *, int *, int *);
int genindexgrid(int gridID1, int *lat1, int *lat2, int *lon11, int *lon12,
                 int *lon21, int *lon22) {
  int gridID2;
  genindexbox(0, gridID1, lat1, lat2, lon11, lon12, lon21, lon22);
  gridID2 = gengrid(gridID1, *lat1, *lat2, *lon11, *lon12, *lon21, *lon22);
  return (gridID2);
}


x86 assembly (clang, -O0):
<genindexgrid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    0x10(%rbp),%rax
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
mov    -0x28(%rbp),%r9
mov    -0x30(%rbp),%r10
mov    0x10(%rbp),%rax
xor    %edi,%edi
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
call   1030 <genindexbox@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
mov    -0x18(%rbp),%rax
mov    (%rax),%edx
mov    -0x20(%rbp),%rax
mov    (%rax),%ecx
mov    -0x28(%rbp),%rax
mov    (%rax),%r8d
mov    -0x30(%rbp),%rax
mov    (%rax),%r9d
mov    0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,(%rsp)
call   1040 <gengrid@plt>
mov    %eax,-0x34(%rbp)
mov    -0x34(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<genindexgrid>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r9,%r14
mov    %r8,%r15
mov    %rcx,%r12
mov    %rdx,%r13
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %edi,%edi
mov    %ebp,%esi
mov    %rbx,%rdx
mov    %r13,%rcx
mov    %r12,%r8
mov    %r15,%r9
push   0x40(%rsp)
push   %r14
call   1030 <genindexbox@plt>
add    $0x10,%rsp
mov    (%rbx),%esi
mov    0x0(%r13),%edx
mov    (%r12),%ecx
mov    (%r15),%r8d
mov    (%r14),%r9d
mov    0x40(%rsp),%rax
mov    (%rax),%eax
sub    $0x8,%rsp
mov    %ebp,%edi
push   %rax
call   1040 <gengrid@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @genindexgrid(i32 %0, i32* %1, i32* %2, i32* %3, i32* %4, i32* %5, i32* %6) {
%8 = alloca i32
%9 = alloca i32*
%10 = alloca i32*
%11 = alloca i32*
%12 = alloca i32*
%13 = alloca i32*
%14 = alloca i32*
%15 = alloca i32
store i32 %0, i32* %8
store i32* %1, i32** %9
store i32* %2, i32** %10
store i32* %3, i32** %11
store i32* %4, i32** %12
store i32* %5, i32** %13
store i32* %6, i32** %14
%16 = load i32, i32* %8
%17 = load i32*, i32** %9
%18 = load i32*, i32** %10
%19 = load i32*, i32** %11
%20 = load i32*, i32** %12
%21 = load i32*, i32** %13
%22 = load i32*, i32** %14
%23 = call i32 @genindexbox(i32 0, i32 %16, i32* %17, i32* %18, i32* %19, i32* %20, i32* %21, i32* %22)
%24 = load i32, i32* %8
%25 = load i32*, i32** %9
%26 = load i32, i32* %25
%27 = load i32*, i32** %10
%28 = load i32, i32* %27
%29 = load i32*, i32** %11
%30 = load i32, i32* %29
%31 = load i32*, i32** %12
%32 = load i32, i32* %31
%33 = load i32*, i32** %13
%34 = load i32, i32* %33
%35 = load i32*, i32** %14
%36 = load i32, i32* %35
%37 = call i32 @gengrid(i32 %24, i32 %26, i32 %28, i32 %30, i32 %32, i32 %34, i32 %36)
store i32 %37, i32* %15
%38 = load i32, i32* %15
ret i32 %38
}

LLVM IR (-O2):
define i32 @genindexgrid(i32 %0, i32* %1, i32* %2, i32* %3, i32* %4, i32* %5, i32* %6) {
%8 = tail call i32 @genindexbox(i32 0, i32 %0, i32* %1, i32* %2, i32* %3, i32* %4, i32* %5, i32* %6)
%9 = load i32, i32* %1
%10 = load i32, i32* %2
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = tail call i32 @gengrid(i32 %0, i32 %9, i32 %10, i32 %11, i32 %12, i32 %13, i32 %14)
ret i32 %15
}