#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*/ ground(double, double, double);
void groundplane() {
  double x = -2;
  double y = 0.09;
  double z = 2;
  for (int j = 0; j < 21; j++) {
    for (int i = 0; i < 20; i++) {
      ground(x, y, z);
      x += .2;
    }
    x = -2;
    z -= .2;
  }
}


x86 assembly (clang, -O0):
<groundplane>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  0xef0(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  0xedb(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xec6(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x15,-0x1c(%rbp)
jge    11c6 <groundplane+0xb6>
movl   $0x0,-0x20(%rbp)
cmpl   $0x14,-0x20(%rbp)
jge    1195 <groundplane+0x85>
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
call   1030 <ground@plt>
movsd  0xe9b(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1157 <groundplane+0x47>
movsd  0xe73(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xe69(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1146 <groundplane+0x36>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<groundplane>:
push   %rbx
sub    $0x10,%rsp
movsd  0xee3(%rip),%xmm0
mov    $0x15,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsd  %xmm0,0x8(%rsp)
movsd  0xeca(%rip),%xmm0
movsd  0xeca(%rip),%xmm1
movsd  0x8(%rsp),%xmm2
call   1030 <ground@plt>
movsd  0xebf(%rip),%xmm0
movsd  0xeaf(%rip),%xmm1
movsd  0x8(%rsp),%xmm2
call   1030 <ground@plt>
movsd  0xeac(%rip),%xmm0
movsd  0xe94(%rip),%xmm1
movsd  0x8(%rsp),%xmm2
call   1030 <ground@plt>
movsd  0xe99(%rip),%xmm0
movsd  0xe79(%rip),%xmm1
movsd  0x8(%rsp),%xmm2
call   1030 <ground@plt>
movsd  0xe86(%rip),%xmm0
movsd  0xe5e(%rip),%xmm1
movsd  0x8(%rsp),%xmm2
call   1030 <ground@plt>
movsd  0xe73(%rip),%xmm0
movsd  0xe43(%rip),%xmm1
movsd  0x8(%rsp),%xmm2
call   1030 <ground@plt>
movsd  0xe60(%rip),%xmm0
movsd  0xe28(%rip),%xmm1
movsd  0x8(%rsp),%xmm2
call   1030 <ground@plt>
movsd  0xe4d(%rip),%xmm0
movsd  0xe0d(%rip),%xmm1
movsd  0x8(%rsp),%xmm2
call   1030 <ground@plt>
movsd  0xe3a(%rip),%xmm0
movsd  0xdf2(%rip),%xmm1
movsd  0x8(%rsp),%xmm2
call   1030 <ground@plt>
movsd  0xe27(%rip),%xmm0
movsd  0xdd7(%rip),%xmm1
movsd  0x8(%rsp),%xmm2
call   1030 <ground@plt>
movsd  0xe14(%rip),%xmm0
movsd  0xdbc(%rip),%xmm1
movsd  0x8(%rsp),%xmm2
call   1030 <ground@plt>
movsd  0xe01(%rip),%xmm0
movsd  0xda1(%rip),%xmm1
movsd  0x8(%rsp),%xmm2
call   1030 <ground@plt>
movsd  0xdee(%rip),%xmm0
movsd  0xd86(%rip),%xmm1
movsd  0x8(%rsp),%xmm2
call   1030 <ground@plt>
movsd  0xddb(%rip),%xmm0
movsd  0xd6b(%rip),%xmm1
movsd  0x8(%rsp),%xmm2
call   1030 <ground@plt>
movsd  0xdc8(%rip),%xmm0
movsd  0xd50(%rip),%xmm1
movsd  0x8(%rsp),%xmm2
call   1030 <ground@plt>
movsd  0xdb5(%rip),%xmm0
movsd  0xd35(%rip),%xmm1
movsd  0x8(%rsp),%xmm2
call   1030 <ground@plt>
movsd  0xda2(%rip),%xmm0
movsd  0xd1a(%rip),%xmm1
movsd  0x8(%rsp),%xmm2
call   1030 <ground@plt>
movsd  0xd8f(%rip),%xmm0
movsd  0xcff(%rip),%xmm1
movsd  0x8(%rsp),%xmm2
call   1030 <ground@plt>
movsd  0xd7c(%rip),%xmm0
movsd  0xce4(%rip),%xmm1
movsd  0x8(%rsp),%xmm2
call   1030 <ground@plt>
movsd  0xd69(%rip),%xmm0
movsd  0xcc9(%rip),%xmm1
movsd  0x8(%rsp),%xmm2
call   1030 <ground@plt>
movsd  0x8(%rsp),%xmm0
addsd  0xd50(%rip),%xmm0
add    $0xffffffff,%ebx
jne    1130 <groundplane+0x20>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @groundplane() {
%1 = alloca double
%2 = alloca double
%3 = alloca double
%4 = alloca i32
%5 = alloca i32
store double -2.000000e+00, double* %1
store double 0x3FB70A3D70A3D70A, double* %2
store double 2.000000e+00, double* %3
store i32 0, i32* %4
br label %6
6: ; preds = %26, %0
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 21
br i1 %8, label %9, label %29
9: ; preds = %6
store i32 0, i32* %5
br label %10
10: ; preds = %20, %9
%11 = load i32, i32* %5
%12 = icmp slt i32 %11, 20
br i1 %12, label %13, label %23
13: ; preds = %10
%14 = load double, double* %1
%15 = load double, double* %2
%16 = load double, double* %3
%17 = call i32 @ground(double %14, double %15, double %16)
%18 = load double, double* %1
%19 = fadd double %18, 2.000000e-01
store double %19, double* %1
br label %20
20: ; preds = %13
%21 = load i32, i32* %5
%22 = add nsw i32 %21, 1
store i32 %22, i32* %5
br label %10
23: ; preds = %10
store double -2.000000e+00, double* %1
%24 = load double, double* %3
%25 = fsub double %24, 2.000000e-01
store double %25, double* %3
br label %26
26: ; preds = %23
%27 = load i32, i32* %4
%28 = add nsw i32 %27, 1
store i32 %28, i32* %4
br label %6
29: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @groundplane() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %25, %1 ]
%3 = phi double [ 2.000000e+00, %0 ], [ %24, %1 ]
%4 = tail call i32 @ground(double -2.000000e+00, double 0x3FB70A3D70A3D70A, double %3)
%5 = tail call i32 @ground(double -1.800000e+00, double 0x3FB70A3D70A3D70A, double %3)
%6 = tail call i32 @ground(double -1.600000e+00, double 0x3FB70A3D70A3D70A, double %3)
%7 = tail call i32 @ground(double 0xBFF6666666666667, double 0x3FB70A3D70A3D70A, double %3)
%8 = tail call i32 @ground(double 0xBFF3333333333334, double 0x3FB70A3D70A3D70A, double %3)
%9 = tail call i32 @ground(double 0xBFF0000000000001, double 0x3FB70A3D70A3D70A, double %3)
%10 = tail call i32 @ground(double 0xBFE999999999999C, double 0x3FB70A3D70A3D70A, double %3)
%11 = tail call i32 @ground(double 0xBFE3333333333336, double 0x3FB70A3D70A3D70A, double %3)
%12 = tail call i32 @ground(double 0xBFD999999999999F, double 0x3FB70A3D70A3D70A, double %3)
%13 = tail call i32 @ground(double 0xBFC99999999999A4, double 0x3FB70A3D70A3D70A, double %3)
%14 = tail call i32 @ground(double 0xBCB4000000000000, double 0x3FB70A3D70A3D70A, double %3)
%15 = tail call i32 @ground(double 0x3FC9999999999990, double 0x3FB70A3D70A3D70A, double %3)
%16 = tail call i32 @ground(double 0x3FD9999999999995, double 0x3FB70A3D70A3D70A, double %3)
%17 = tail call i32 @ground(double 0x3FE3333333333331, double 0x3FB70A3D70A3D70A, double %3)
%18 = tail call i32 @ground(double 0x3FE9999999999998, double 0x3FB70A3D70A3D70A, double %3)
%19 = tail call i32 @ground(double 0x3FEFFFFFFFFFFFFE, double 0x3FB70A3D70A3D70A, double %3)
%20 = tail call i32 @ground(double 0x3FF3333333333332, double 0x3FB70A3D70A3D70A, double %3)
%21 = tail call i32 @ground(double 0x3FF6666666666665, double 0x3FB70A3D70A3D70A, double %3)
%22 = tail call i32 @ground(double 0x3FF9999999999998, double 0x3FB70A3D70A3D70A, double %3)
%23 = tail call i32 @ground(double 0x3FFCCCCCCCCCCCCB, double 0x3FB70A3D70A3D70A, double %3)
%24 = fadd double %3, -2.000000e-01
%25 = add nuw nsw i32 %2, 1
%26 = icmp eq i32 %25, 21
br i1 %26, label %27, label %1
27: ; preds = %1
ret void
}