#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 */
scalar_t__ fabs(double);
void gridGenXvals(int xsize, double xfirst, double xlast, double xinc,
                  double *xvals) {
  if ((!(fabs(xinc) > 0)) && xsize > 1) {
    if (xfirst >= xlast) {
      while (xfirst >= xlast)
        xlast += 360;
      xinc = (xlast - xfirst) / (xsize);
    } else {
      xinc = (xlast - xfirst) / (xsize - 1);
    }
  }
  for (int i = 0; i < xsize; ++i)
    xvals[i] = xfirst + i * xinc;
}


x86 assembly (clang, -O0):
<gridGenXvals>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
mov    %rsi,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm0
call   1030 <fabs@plt>
cmp    $0x0,%rax
jg     11c7 <gridGenXvals+0xb7>
cmpl   $0x1,-0x4(%rbp)
jle    11c7 <gridGenXvals+0xb7>
movsd  -0x10(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jb     11a5 <gridGenXvals+0x95>
jmp    1161 <gridGenXvals+0x51>
movsd  -0x10(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jb     1188 <gridGenXvals+0x78>
movsd  0xe87(%rip),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1161 <gridGenXvals+0x51>
movsd  -0x18(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
cvtsi2sdl -0x4(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    11c2 <gridGenXvals+0xb2>
movsd  -0x18(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
cvtsi2sd %eax,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    11c7 <gridGenXvals+0xb7>
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    120c <gridGenXvals+0xfc>
movsd  -0x10(%rbp),%xmm1
cvtsi2sdl -0x2c(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x28(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    11ce <gridGenXvals+0xbe>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gridGenXvals>:
push   %r14
push   %rbx
sub    $0x38,%rsp
mov    %rsi,%rbx
movsd  %xmm1,0x8(%rsp)
movaps %xmm0,0x20(%rsp)
mov    %edi,%r14d
movapd %xmm2,0x10(%rsp)
movapd %xmm2,%xmm0
call   1030 <fabs@plt>
cmp    $0x2,%r14d
jl     1169 <gridGenXvals+0x59>
test   %rax,%rax
movapd 0x20(%rsp),%xmm4
jg     11a4 <gridGenXvals+0x94>
movsd  0x8(%rsp),%xmm5
ucomisd %xmm5,%xmm4
jae    1171 <gridGenXvals+0x61>
subsd  %xmm4,%xmm5
lea    -0x1(%r14),%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
divsd  %xmm0,%xmm5
jmp    11b3 <gridGenXvals+0xa3>
movapd 0x20(%rsp),%xmm4
jmp    11a4 <gridGenXvals+0x94>
movsd  0xe87(%rip),%xmm0
nopl   0x0(%rax)
addsd  %xmm0,%xmm5
ucomisd %xmm5,%xmm4
jae    1180 <gridGenXvals+0x70>
subsd  %xmm4,%xmm5
xorps  %xmm0,%xmm0
cvtsi2sd %r14d,%xmm0
divsd  %xmm0,%xmm5
movapd %xmm5,%xmm0
movapd %xmm5,0x10(%rsp)
test   %r14d,%r14d
movapd 0x10(%rsp),%xmm5
jle    12fd <gridGenXvals+0x1ed>
mov    %r14d,%eax
cmp    $0x4,%r14d
jae    11c3 <gridGenXvals+0xb3>
xor    %ecx,%ecx
jmp    12e0 <gridGenXvals+0x1d0>
mov    %eax,%ecx
and    $0xfffffffc,%ecx
movapd %xmm5,%xmm0
unpcklpd %xmm5,%xmm0
movapd %xmm4,%xmm1
unpcklpd %xmm4,%xmm1
lea    -0x4(%rcx),%rdx
mov    %rdx,%rsi
shr    $0x2,%rsi
add    $0x1,%rsi
test   %rdx,%rdx
je     1305 <gridGenXvals+0x1f5>
mov    %rsi,%rdi
and    $0xfffffffffffffffe,%rdi
movdqa 0xe11(%rip),%xmm2
xor    %edx,%edx
movdqa 0xe16(%rip),%xmm8
movdqa 0xe1d(%rip),%xmm9
movdqa 0xe24(%rip),%xmm10
movdqa 0xe2c(%rip),%xmm6
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movdqa %xmm2,%xmm7
cvtdq2pd %xmm2,%xmm3
paddd  %xmm8,%xmm7
cvtdq2pd %xmm7,%xmm7
mulpd  %xmm0,%xmm3
addpd  %xmm1,%xmm3
mulpd  %xmm0,%xmm7
addpd  %xmm1,%xmm7
movupd %xmm3,(%rbx,%rdx,8)
movupd %xmm7,0x10(%rbx,%rdx,8)
movdqa %xmm2,%xmm3
paddd  %xmm9,%xmm3
movdqa %xmm2,%xmm7
cvtdq2pd %xmm3,%xmm3
paddd  %xmm10,%xmm7
cvtdq2pd %xmm7,%xmm7
mulpd  %xmm0,%xmm3
addpd  %xmm1,%xmm3
mulpd  %xmm0,%xmm7
addpd  %xmm1,%xmm7
movupd %xmm3,0x20(%rbx,%rdx,8)
movupd %xmm7,0x30(%rbx,%rdx,8)
add    $0x8,%rdx
paddd  %xmm6,%xmm2
add    $0xfffffffffffffffe,%rdi
jne    1230 <gridGenXvals+0x120>
test   $0x1,%sil
je     12d1 <gridGenXvals+0x1c1>
cvtdq2pd %xmm2,%xmm3
paddd  0xd6e(%rip),%xmm2
cvtdq2pd %xmm2,%xmm2
mulpd  %xmm0,%xmm3
addpd  %xmm1,%xmm3
mulpd  %xmm0,%xmm2
addpd  %xmm1,%xmm2
movupd %xmm3,(%rbx,%rdx,8)
movupd %xmm2,0x10(%rbx,%rdx,8)
cmp    %rax,%rcx
je     12fd <gridGenXvals+0x1ed>
cs nopw 0x0(%rax,%rax,1)
xorps  %xmm0,%xmm0
cvtsi2sd %ecx,%xmm0
mulsd  %xmm5,%xmm0
addsd  %xmm4,%xmm0
movsd  %xmm0,(%rbx,%rcx,8)
add    $0x1,%rcx
cmp    %rcx,%rax
jne    12e0 <gridGenXvals+0x1d0>
add    $0x38,%rsp
pop    %rbx
pop    %r14
ret
movdqa 0xd03(%rip),%xmm2
xor    %edx,%edx
test   $0x1,%sil
jne    12a6 <gridGenXvals+0x196>
jmp    12d1 <gridGenXvals+0x1c1>

LLVM IR (-O0):
define void @gridGenXvals(i32 %0, double %1, double %2, double %3, double* %4) {
%6 = alloca i32
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double*
%11 = alloca i32
store i32 %0, i32* %6
store double %1, double* %7
store double %2, double* %8
store double %3, double* %9
store double* %4, double** %10
%12 = load double, double* %9
%13 = call i64 @fabs(double %12)
%14 = icmp sgt i64 %13, 0
br i1 %14, label %46, label %15
15: ; preds = %5
%16 = load i32, i32* %6
%17 = icmp sgt i32 %16, 1
br i1 %17, label %18, label %46
18: ; preds = %15
%19 = load double, double* %7
%20 = load double, double* %8
%21 = fcmp oge double %19, %20
br i1 %21, label %22, label %37
22: ; preds = %18
br label %23
23: ; preds = %27, %22
%24 = load double, double* %7
%25 = load double, double* %8
%26 = fcmp oge double %24, %25
br i1 %26, label %27, label %30
27: ; preds = %23
%28 = load double, double* %8
%29 = fadd double %28, 3.600000e+02
store double %29, double* %8
br label %23
30: ; preds = %23
%31 = load double, double* %8
%32 = load double, double* %7
%33 = fsub double %31, %32
%34 = load i32, i32* %6
%35 = sitofp i32 %34 to double
%36 = fdiv double %33, %35
store double %36, double* %9
br label %45
37: ; preds = %18
%38 = load double, double* %8
%39 = load double, double* %7
%40 = fsub double %38, %39
%41 = load i32, i32* %6
%42 = sub nsw i32 %41, 1
%43 = sitofp i32 %42 to double
%44 = fdiv double %40, %43
store double %44, double* %9
br label %45
45: ; preds = %37, %30
br label %46
46: ; preds = %45, %15, %5
store i32 0, i32* %11
br label %47
47: ; preds = %61, %46
%48 = load i32, i32* %11
%49 = load i32, i32* %6
%50 = icmp slt i32 %48, %49
br i1 %50, label %51, label %64
51: ; preds = %47
%52 = load double, double* %7
%53 = load i32, i32* %11
%54 = sitofp i32 %53 to double
%55 = load double, double* %9
%56 = call double @llvm.fmuladd.f64(double %54, double %55, double %52)
%57 = load double*, double** %10
%58 = load i32, i32* %11
%59 = sext i32 %58 to i64
%60 = getelementptr inbounds double, double* %57, i64 %59
store double %56, double* %60
br label %61
61: ; preds = %51
%62 = load i32, i32* %11
%63 = add nsw i32 %62, 1
store i32 %63, i32* %11
br label %47
64: ; preds = %47
ret void
}

LLVM IR (-O2):
define void @gridGenXvals(i32 %0, double %1, double %2, double %3, double* nocapture writeonly %4) {
%6 = tail call i64 @fabs(double %3)
%7 = icmp slt i64 %6, 1
%8 = icmp sgt i32 %0, 1
%9 = and i1 %8, %7
br i1 %9, label %10, label %25
10: ; preds = %5
%11 = fcmp ult double %1, %2
br i1 %11, label %20, label %12
12: ; preds = %10, %12
%13 = phi double [ %14, %12 ], [ %2, %10 ]
%14 = fadd double %13, 3.600000e+02
%15 = fcmp ugt double %14, %1
br i1 %15, label %16, label %12
16: ; preds = %12
%17 = fsub double %14, %1
%18 = sitofp i32 %0 to double
%19 = fdiv double %17, %18
br label %25
20: ; preds = %10
%21 = fsub double %2, %1
%22 = add nsw i32 %0, -1
%23 = sitofp i32 %22 to double
%24 = fdiv double %21, %23
br label %28
25: ; preds = %16, %5
%26 = phi double [ %19, %16 ], [ %3, %5 ]
%27 = icmp sgt i32 %0, 0
br i1 %27, label %28, label %95
28: ; preds = %20, %25
%29 = phi double [ %24, %20 ], [ %26, %25 ]
%30 = zext i32 %0 to i64
%31 = icmp ult i32 %0, 4
br i1 %31, label %93, label %32
32: ; preds = %28
%33 = and i64 %30, 4294967292
%34 = insertelement <2 x double> poison, double %29, i64 0
%35 = shufflevector <2 x double> %34, <2 x double> poison, <2 x i32> zeroinitializer
%36 = insertelement <2 x double> poison, double %1, i64 0
%37 = shufflevector <2 x double> %36, <2 x double> poison, <2 x i32> zeroinitializer
%38 = insertelement <2 x double> poison, double %29, i64 0
%39 = shufflevector <2 x double> %38, <2 x double> poison, <2 x i32> zeroinitializer
%40 = insertelement <2 x double> poison, double %1, i64 0
%41 = shufflevector <2 x double> %40, <2 x double> poison, <2 x i32> zeroinitializer
%42 = add nsw i64 %33, -4
%43 = lshr exact i64 %42, 2
%44 = add nuw nsw i64 %43, 1
%45 = and i64 %44, 1
%46 = icmp eq i64 %42, 0
br i1 %46, label %77, label %47
47: ; preds = %32
%48 = and i64 %44, 9223372036854775806
br label %49
49: ; preds = %49, %47
%50 = phi i64 [ 0, %47 ], [ %73, %49 ]
%51 = phi <2 x i32> [ <i32 0, i32 1>, %47 ], [ %74, %49 ]
%52 = phi i64 [ 0, %47 ], [ %75, %49 ]
%53 = add <2 x i32> %51, <i32 2, i32 2>
%54 = sitofp <2 x i32> %51 to <2 x double>
%55 = sitofp <2 x i32> %53 to <2 x double>
%56 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %54, <2 x double> %35, <2 x double> %37)
%57 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %55, <2 x double> %39, <2 x double> %41)
%58 = getelementptr inbounds double, double* %4, i64 %50
%59 = bitcast double* %58 to <2 x double>*
store <2 x double> %56, <2 x double>* %59
%60 = getelementptr inbounds double, double* %58, i64 2
%61 = bitcast double* %60 to <2 x double>*
store <2 x double> %57, <2 x double>* %61
%62 = or i64 %50, 4
%63 = add <2 x i32> %51, <i32 4, i32 4>
%64 = add <2 x i32> %51, <i32 6, i32 6>
%65 = sitofp <2 x i32> %63 to <2 x double>
%66 = sitofp <2 x i32> %64 to <2 x double>
%67 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %65, <2 x double> %35, <2 x double> %37)
%68 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %66, <2 x double> %39, <2 x double> %41)
%69 = getelementptr inbounds double, double* %4, i64 %62
%70 = bitcast double* %69 to <2 x double>*
store <2 x double> %67, <2 x double>* %70
%71 = getelementptr inbounds double, double* %69, i64 2
%72 = bitcast double* %71 to <2 x double>*
store <2 x double> %68, <2 x double>* %72
%73 = add nuw i64 %50, 8
%74 = add <2 x i32> %51, <i32 8, i32 8>
%75 = add i64 %52, 2
%76 = icmp eq i64 %75, %48
br i1 %76, label %77, label %49
77: ; preds = %49, %32
%78 = phi i64 [ 0, %32 ], [ %73, %49 ]
%79 = phi <2 x i32> [ <i32 0, i32 1>, %32 ], [ %74, %49 ]
%80 = icmp eq i64 %45, 0
br i1 %80, label %91, label %81
81: ; preds = %77
%82 = add <2 x i32> %79, <i32 2, i32 2>
%83 = sitofp <2 x i32> %79 to <2 x double>
%84 = sitofp <2 x i32> %82 to <2 x double>
%85 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %83, <2 x double> %35, <2 x double> %37)
%86 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %84, <2 x double> %39, <2 x double> %41)
%87 = getelementptr inbounds double, double* %4, i64 %78
%88 = bitcast double* %87 to <2 x double>*
store <2 x double> %85, <2 x double>* %88
%89 = getelementptr inbounds double, double* %87, i64 2
%90 = bitcast double* %89 to <2 x double>*
store <2 x double> %86, <2 x double>* %90
br label %91
91: ; preds = %77, %81
%92 = icmp eq i64 %33, %30
br i1 %92, label %95, label %93
93: ; preds = %28, %91
%94 = phi i64 [ 0, %28 ], [ %33, %91 ]
br label %96
95: ; preds = %96, %91, %25
ret void
96: ; preds = %93, %96
%97 = phi i64 [ %102, %96 ], [ %94, %93 ]
%98 = trunc i64 %97 to i32
%99 = sitofp i32 %98 to double
%100 = tail call double @llvm.fmuladd.f64(double %99, double %29, double %1)
%101 = getelementptr inbounds double, double* %4, i64 %97
store double %100, double* %101
%102 = add nuw nsw i64 %97, 1
%103 = icmp eq i64 %102, %30
br i1 %103, label %95, label %96
}