int main(int argc, const char *argv[]) {
  double *latitudes;
  int count = 0;
  int n, i;
  if (argc != 2)
    usage(argv[0]);
  n = atol(argv[1]);
  count = n * 2;
  latitudes = (double *)malloc(count * sizeof(double));
  assert(latitudes);
  assert(grib_get_gaussian_latitudes(n, latitudes) == 0);
  for (i = 0; i < count; i++)
    printf("%g\n", latitudes[i]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     1195 <main+0x35>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    $0x0,%al
call   1060 <usage@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    $0x0,%al
call   1080 <atol@plt>
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x1c(%rbp)
movslq -0x1c(%rbp),%rdi
shl    $0x3,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0x0,%al
call   1040 <assert@plt>
mov    -0x20(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    $0x0,%al
call   1070 <grib_get_gaussian_latitudes@plt>
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1040 <assert@plt>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    1228 <main+0xc8>
mov    -0x18(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0xded(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    11f3 <main+0x93>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rsi,%rbx
cmp    $0x2,%edi
je     117a <main+0x1a>
mov    (%rbx),%rdi
xor    %eax,%eax
call   1060 <usage@plt>
mov    0x8(%rbx),%rdi
xor    %eax,%eax
call   1080 <atol@plt>
mov    %eax,%r14d
lea    (%r14,%r14,1),%r15d
movslq %r15d,%rdi
shl    $0x3,%rdi
call   1050 <malloc@plt>
mov    %rax,%r12
mov    %rax,%rdi
xor    %eax,%eax
call   1040 <assert@plt>
mov    %r14d,%edi
mov    %r12,%rsi
xor    %eax,%eax
call   1070 <grib_get_gaussian_latitudes@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
xor    %eax,%eax
call   1040 <assert@plt>
test   %r14d,%r14d
jle    11f9 <main+0x99>
cmp    $0x2,%r15d
mov    $0x1,%ebp
cmovge %r15d,%ebp
xor    %ebx,%ebx
lea    0xe24(%rip),%r14
nopl   0x0(%rax)
movsd  (%r12,%rbx,8),%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    11e0 <main+0x80>
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%g\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca double*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %7
%10 = load i32, i32* %4
%11 = icmp ne i32 %10, 2
br i1 %11, label %12, label %17
12: ; preds = %2
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i64 0
%15 = load i8*, i8** %14
%16 = call i32 (i8*, ...) bitcast (i32 (...)* @usage to i32 (i8*, ...)*)(i8* %15)
br label %17
17: ; preds = %12, %2
%18 = load i8**, i8*** %5
%19 = getelementptr inbounds i8*, i8** %18, i64 1
%20 = load i8*, i8** %19
%21 = call i32 (i8*, ...) bitcast (i32 (...)* @atol to i32 (i8*, ...)*)(i8* %20)
store i32 %21, i32* %8
%22 = load i32, i32* %8
%23 = mul nsw i32 %22, 2
store i32 %23, i32* %7
%24 = load i32, i32* %7
%25 = sext i32 %24 to i64
%26 = mul i64 %25, 8
%27 = call i8* @malloc(i64 %26)
%28 = bitcast i8* %27 to double*
store double* %28, double** %6
%29 = load double*, double** %6
%30 = call i32 (double*, ...) bitcast (i32 (...)* @assert to i32 (double*, ...)*)(double* %29)
%31 = load i32, i32* %8
%32 = load double*, double** %6
%33 = call i32 (i32, double*, ...) bitcast (i32 (...)* @grib_get_gaussian_latitudes to i32 (i32, double*, ...)*)(i32 %31, double* %32)
%34 = icmp eq i32 %33, 0
%35 = zext i1 %34 to i32
%36 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %35)
store i32 0, i32* %9
br label %37
37: ; preds = %48, %17
%38 = load i32, i32* %9
%39 = load i32, i32* %7
%40 = icmp slt i32 %38, %39
br i1 %40, label %41, label %51
41: ; preds = %37
%42 = load double*, double** %6
%43 = load i32, i32* %9
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds double, double* %42, i64 %44
%46 = load double, double* %45
%47 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %46)
br label %48
48: ; preds = %41
%49 = load i32, i32* %9
%50 = add nsw i32 %49, 1
store i32 %50, i32* %9
br label %37
51: ; preds = %37
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%g\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = load i8*, i8** %1
%6 = tail call i32 (i8*, ...) bitcast (i32 (...)* @usage to i32 (i8*, ...)*)(i8* %5)
br label %7
7: ; preds = %4, %2
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = tail call i32 (i8*, ...) bitcast (i32 (...)* @atol to i32 (i8*, ...)*)(i8* %9)
%11 = shl nsw i32 %10, 1
%12 = sext i32 %11 to i64
%13 = shl nsw i64 %12, 3
%14 = tail call i8* @malloc(i64 %13)
%15 = bitcast i8* %14 to double*
%16 = tail call i32 (double*, ...) bitcast (i32 (...)* @assert to i32 (double*, ...)*)(double* %15)
%17 = tail call i32 (i32, double*, ...) bitcast (i32 (...)* @grib_get_gaussian_latitudes to i32 (i32, double*, ...)*)(i32 %10, double* %15)
%18 = icmp eq i32 %17, 0
%19 = zext i1 %18 to i32
%20 = tail call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %19)
%21 = icmp sgt i32 %10, 0
br i1 %21, label %22, label %32
22: ; preds = %7
%23 = call i32 @llvm.smax.i32(i32 %11, i32 1)
%24 = zext i32 %23 to i64
br label %25
25: ; preds = %22, %25
%26 = phi i64 [ 0, %22 ], [ %30, %25 ]
%27 = getelementptr inbounds double, double* %15, i64 %26
%28 = load double, double* %27
%29 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %28)
%30 = add nuw nsw i64 %26, 1
%31 = icmp eq i64 %30, %24
br i1 %31, label %32, label %25
32: ; preds = %25, %7
ret i32 0
}