#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*/ set_coor(double, double, double, int *, double **);
void fill_arround(double *loc, double dlat, double dlon, double dep, int *Ngrid,
                  double **new_loc) {
  set_coor(loc[0] + dlat, loc[1] - dlon, dep, Ngrid, new_loc);
  set_coor(loc[0] + dlat, loc[1], dep, Ngrid, new_loc);
  set_coor(loc[0] + dlat, loc[1] + dlon, dep, Ngrid, new_loc);
  set_coor(loc[0], loc[1] + dlon, dep, Ngrid, new_loc);
  set_coor(loc[0] - dlat, loc[1] + dlon, dep, Ngrid, new_loc);
  set_coor(loc[0] - dlat, loc[1], dep, Ngrid, new_loc);
  set_coor(loc[0] - dlat, loc[1] - dlon, dep, Ngrid, new_loc);
  set_coor(loc[0], loc[1] - dlon, dep, Ngrid, new_loc);
}


x86 assembly (clang, -O0):
<fill_arround>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
mov    %rsi,-0x28(%rbp)
mov    %rdx,-0x30(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
addsd  -0x10(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm1
subsd  -0x18(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
mov    -0x28(%rbp),%rdi
mov    -0x30(%rbp),%rsi
call   1030 <set_coor@plt>
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
addsd  -0x10(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm1
movsd  -0x20(%rbp),%xmm2
mov    -0x28(%rbp),%rdi
mov    -0x30(%rbp),%rsi
call   1030 <set_coor@plt>
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
addsd  -0x10(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm1
addsd  -0x18(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
mov    -0x28(%rbp),%rdi
mov    -0x30(%rbp),%rsi
call   1030 <set_coor@plt>
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm1
addsd  -0x18(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
mov    -0x28(%rbp),%rdi
mov    -0x30(%rbp),%rsi
call   1030 <set_coor@plt>
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
subsd  -0x10(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm1
addsd  -0x18(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
mov    -0x28(%rbp),%rdi
mov    -0x30(%rbp),%rsi
call   1030 <set_coor@plt>
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
subsd  -0x10(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm1
movsd  -0x20(%rbp),%xmm2
mov    -0x28(%rbp),%rdi
mov    -0x30(%rbp),%rsi
call   1030 <set_coor@plt>
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
subsd  -0x10(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm1
subsd  -0x18(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
mov    -0x28(%rbp),%rdi
mov    -0x30(%rbp),%rsi
call   1030 <set_coor@plt>
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm1
subsd  -0x18(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
mov    -0x28(%rbp),%rdi
mov    -0x30(%rbp),%rsi
call   1030 <set_coor@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fill_arround>:
push   %r15
push   %r14
push   %rbx
sub    $0x20,%rsp
mov    %rdx,%r14
mov    %rsi,%r15
movsd  %xmm2,0x8(%rsp)
movapd %xmm1,%xmm3
movsd  %xmm1,0x18(%rsp)
movapd %xmm0,%xmm1
movsd  %xmm0,0x10(%rsp)
mov    %rdi,%rbx
movsd  (%rdi),%xmm0
addsd  %xmm1,%xmm0
movsd  0x8(%rdi),%xmm1
subsd  %xmm3,%xmm1
mov    %rsi,%rdi
mov    %rdx,%rsi
call   1030 <set_coor@plt>
movsd  (%rbx),%xmm0
addsd  0x10(%rsp),%xmm0
movsd  0x8(%rbx),%xmm1
movsd  0x8(%rsp),%xmm2
mov    %r15,%rdi
mov    %r14,%rsi
call   1030 <set_coor@plt>
movsd  (%rbx),%xmm0
addsd  0x10(%rsp),%xmm0
movsd  0x8(%rbx),%xmm1
addsd  0x18(%rsp),%xmm1
movsd  0x8(%rsp),%xmm2
mov    %r15,%rdi
mov    %r14,%rsi
call   1030 <set_coor@plt>
movsd  (%rbx),%xmm0
movsd  0x8(%rbx),%xmm1
addsd  0x18(%rsp),%xmm1
movsd  0x8(%rsp),%xmm2
mov    %r15,%rdi
mov    %r14,%rsi
call   1030 <set_coor@plt>
movsd  (%rbx),%xmm0
subsd  0x10(%rsp),%xmm0
movsd  0x8(%rbx),%xmm1
addsd  0x18(%rsp),%xmm1
movsd  0x8(%rsp),%xmm2
mov    %r15,%rdi
mov    %r14,%rsi
call   1030 <set_coor@plt>
movsd  (%rbx),%xmm0
movsd  0x8(%rbx),%xmm1
subsd  0x10(%rsp),%xmm0
movsd  0x8(%rsp),%xmm2
mov    %r15,%rdi
mov    %r14,%rsi
call   1030 <set_coor@plt>
movsd  (%rbx),%xmm0
movsd  0x8(%rbx),%xmm1
subsd  0x10(%rsp),%xmm0
subsd  0x18(%rsp),%xmm1
movsd  0x8(%rsp),%xmm2
mov    %r15,%rdi
mov    %r14,%rsi
call   1030 <set_coor@plt>
movsd  (%rbx),%xmm0
movsd  0x8(%rbx),%xmm1
subsd  0x18(%rsp),%xmm1
movsd  0x8(%rsp),%xmm2
mov    %r15,%rdi
mov    %r14,%rsi
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <set_coor@plt>

LLVM IR (-O0):
define void @fill_arround(double* %0, double %1, double %2, double %3, i32* %4, double** %5) {
%7 = alloca double*
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca i32*
%12 = alloca double**
store double* %0, double** %7
store double %1, double* %8
store double %2, double* %9
store double %3, double* %10
store i32* %4, i32** %11
store double** %5, double*** %12
%13 = load double*, double** %7
%14 = getelementptr inbounds double, double* %13, i64 0
%15 = load double, double* %14
%16 = load double, double* %8
%17 = fadd double %15, %16
%18 = load double*, double** %7
%19 = getelementptr inbounds double, double* %18, i64 1
%20 = load double, double* %19
%21 = load double, double* %9
%22 = fsub double %20, %21
%23 = load double, double* %10
%24 = load i32*, i32** %11
%25 = load double**, double*** %12
%26 = call i32 @set_coor(double %17, double %22, double %23, i32* %24, double** %25)
%27 = load double*, double** %7
%28 = getelementptr inbounds double, double* %27, i64 0
%29 = load double, double* %28
%30 = load double, double* %8
%31 = fadd double %29, %30
%32 = load double*, double** %7
%33 = getelementptr inbounds double, double* %32, i64 1
%34 = load double, double* %33
%35 = load double, double* %10
%36 = load i32*, i32** %11
%37 = load double**, double*** %12
%38 = call i32 @set_coor(double %31, double %34, double %35, i32* %36, double** %37)
%39 = load double*, double** %7
%40 = getelementptr inbounds double, double* %39, i64 0
%41 = load double, double* %40
%42 = load double, double* %8
%43 = fadd double %41, %42
%44 = load double*, double** %7
%45 = getelementptr inbounds double, double* %44, i64 1
%46 = load double, double* %45
%47 = load double, double* %9
%48 = fadd double %46, %47
%49 = load double, double* %10
%50 = load i32*, i32** %11
%51 = load double**, double*** %12
%52 = call i32 @set_coor(double %43, double %48, double %49, i32* %50, double** %51)
%53 = load double*, double** %7
%54 = getelementptr inbounds double, double* %53, i64 0
%55 = load double, double* %54
%56 = load double*, double** %7
%57 = getelementptr inbounds double, double* %56, i64 1
%58 = load double, double* %57
%59 = load double, double* %9
%60 = fadd double %58, %59
%61 = load double, double* %10
%62 = load i32*, i32** %11
%63 = load double**, double*** %12
%64 = call i32 @set_coor(double %55, double %60, double %61, i32* %62, double** %63)
%65 = load double*, double** %7
%66 = getelementptr inbounds double, double* %65, i64 0
%67 = load double, double* %66
%68 = load double, double* %8
%69 = fsub double %67, %68
%70 = load double*, double** %7
%71 = getelementptr inbounds double, double* %70, i64 1
%72 = load double, double* %71
%73 = load double, double* %9
%74 = fadd double %72, %73
%75 = load double, double* %10
%76 = load i32*, i32** %11
%77 = load double**, double*** %12
%78 = call i32 @set_coor(double %69, double %74, double %75, i32* %76, double** %77)
%79 = load double*, double** %7
%80 = getelementptr inbounds double, double* %79, i64 0
%81 = load double, double* %80
%82 = load double, double* %8
%83 = fsub double %81, %82
%84 = load double*, double** %7
%85 = getelementptr inbounds double, double* %84, i64 1
%86 = load double, double* %85
%87 = load double, double* %10
%88 = load i32*, i32** %11
%89 = load double**, double*** %12
%90 = call i32 @set_coor(double %83, double %86, double %87, i32* %88, double** %89)
%91 = load double*, double** %7
%92 = getelementptr inbounds double, double* %91, i64 0
%93 = load double, double* %92
%94 = load double, double* %8
%95 = fsub double %93, %94
%96 = load double*, double** %7
%97 = getelementptr inbounds double, double* %96, i64 1
%98 = load double, double* %97
%99 = load double, double* %9
%100 = fsub double %98, %99
%101 = load double, double* %10
%102 = load i32*, i32** %11
%103 = load double**, double*** %12
%104 = call i32 @set_coor(double %95, double %100, double %101, i32* %102, double** %103)
%105 = load double*, double** %7
%106 = getelementptr inbounds double, double* %105, i64 0
%107 = load double, double* %106
%108 = load double*, double** %7
%109 = getelementptr inbounds double, double* %108, i64 1
%110 = load double, double* %109
%111 = load double, double* %9
%112 = fsub double %110, %111
%113 = load double, double* %10
%114 = load i32*, i32** %11
%115 = load double**, double*** %12
%116 = call i32 @set_coor(double %107, double %112, double %113, i32* %114, double** %115)
ret void
}

LLVM IR (-O2):
define void @fill_arround(double* nocapture %0, double %1, double %2, double %3, i32* %4, double** %5) {
%7 = load double, double* %0
%8 = fadd double %7, %1
%9 = getelementptr inbounds double, double* %0, i64 1
%10 = load double, double* %9
%11 = fsub double %10, %2
%12 = tail call i32 @set_coor(double %8, double %11, double %3, i32* %4, double** %5)
%13 = load double, double* %0
%14 = fadd double %13, %1
%15 = load double, double* %9
%16 = tail call i32 @set_coor(double %14, double %15, double %3, i32* %4, double** %5)
%17 = load double, double* %0
%18 = fadd double %17, %1
%19 = load double, double* %9
%20 = fadd double %19, %2
%21 = tail call i32 @set_coor(double %18, double %20, double %3, i32* %4, double** %5)
%22 = load double, double* %0
%23 = load double, double* %9
%24 = fadd double %23, %2
%25 = tail call i32 @set_coor(double %22, double %24, double %3, i32* %4, double** %5)
%26 = load double, double* %0
%27 = fsub double %26, %1
%28 = load double, double* %9
%29 = fadd double %28, %2
%30 = tail call i32 @set_coor(double %27, double %29, double %3, i32* %4, double** %5)
%31 = load double, double* %0
%32 = fsub double %31, %1
%33 = load double, double* %9
%34 = tail call i32 @set_coor(double %32, double %33, double %3, i32* %4, double** %5)
%35 = load double, double* %0
%36 = fsub double %35, %1
%37 = load double, double* %9
%38 = fsub double %37, %2
%39 = tail call i32 @set_coor(double %36, double %38, double %3, i32* %4, double** %5)
%40 = load double, double* %0
%41 = load double, double* %9
%42 = fsub double %41, %2
%43 = tail call i32 @set_coor(double %40, double %42, double %3, i32* %4, double** %5)
ret void
}