#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 vlistDefVar(int, int, int, int);
int /*<<< orphan*/ vlistDefVarAddoffset(int, int, double);
int /*<<< orphan*/ vlistDefVarDatatype(int, int, int);
int /*<<< orphan*/ vlistDefVarMissval(int, int, int);
int /*<<< orphan*/ vlistDefVarName(int, int, char *);
int /*<<< orphan*/ vlistDefVarScalefactor(int, int, double);
int /*<<< orphan*/ vlistDefVarUnits(int, int, char *);
void init_amsr_averaged(int vlistID, int gridID, int zaxisID, int nvars) {
  char *name[] = {"sst", "wind", "vapor", "cloud", "rain"};
  char *units[] = {"deg Celcius", "m/s", "mm", "mm", "mm/h"};
  double xscale[] = {0.15, 0.2, 0.3, 0.01, 0.1};
  double xminval[] = {-3., 0., 0., 0., 0.};
  int i, varID;
  for (i = 0; i < nvars; ++i) {
    varID = vlistDefVar(vlistID, gridID, zaxisID, 1);
    vlistDefVarName(vlistID, varID, name[i]);
    vlistDefVarUnits(vlistID, varID, units[i]);
    vlistDefVarDatatype(vlistID, varID, 216);
    vlistDefVarMissval(vlistID, varID, 254);
    vlistDefVarScalefactor(vlistID, varID, xscale[i]);
    vlistDefVarAddoffset(vlistID, varID, xminval[i]);
  }
}


x86 assembly (clang, -O0):
<init_amsr_averaged>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
lea    -0x40(%rbp),%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1070 <memset@plt>
lea    0xe82(%rip),%rax
mov    %rax,-0x40(%rbp)
lea    0xe7b(%rip),%rax
mov    %rax,-0x38(%rbp)
lea    0xe75(%rip),%rax
mov    %rax,-0x30(%rbp)
lea    0xe70(%rip),%rax
mov    %rax,-0x28(%rbp)
lea    0xe6b(%rip),%rax
mov    %rax,-0x20(%rbp)
lea    -0x70(%rbp),%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1070 <memset@plt>
lea    0xe55(%rip),%rax
mov    %rax,-0x70(%rbp)
lea    0xe56(%rip),%rax
mov    %rax,-0x68(%rbp)
lea    0xe4f(%rip),%rax
mov    %rax,-0x60(%rbp)
lea    0xe44(%rip),%rax
mov    %rax,-0x58(%rbp)
lea    0xe3c(%rip),%rax
mov    %rax,-0x50(%rbp)
lea    -0xa0(%rbp),%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1070 <memset@plt>
movsd  0xde8(%rip),%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  0xdd0(%rip),%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movsd  0xdb8(%rip),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  0xda0(%rip),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  0xd88(%rip),%xmm0
movsd  %xmm0,-0x80(%rbp)
lea    -0xd0(%rbp),%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1070 <memset@plt>
movsd  0xd60(%rip),%xmm0
movsd  %xmm0,-0xd0(%rbp)
ff
movl   $0x0,-0xd4(%rbp)
mov    -0xd4(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1384 <init_amsr_averaged+0x204>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    $0x1,%ecx
call   1030 <vlistDefVar@plt>
mov    %eax,-0xd8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0xd8(%rbp),%esi
movslq -0xd4(%rbp),%rax
mov    -0x40(%rbp,%rax,8),%rdx
call   1040 <vlistDefVarName@plt>
mov    -0x4(%rbp),%edi
mov    -0xd8(%rbp),%esi
movslq -0xd4(%rbp),%rax
mov    -0x70(%rbp,%rax,8),%rdx
call   1090 <vlistDefVarUnits@plt>
mov    -0x4(%rbp),%edi
mov    -0xd8(%rbp),%esi
mov    $0xd8,%edx
call   1060 <vlistDefVarDatatype@plt>
mov    -0x4(%rbp),%edi
mov    -0xd8(%rbp),%esi
mov    $0xfe,%edx
call   10a0 <vlistDefVarMissval@plt>
mov    -0x4(%rbp),%edi
mov    -0xd8(%rbp),%esi
movslq -0xd4(%rbp),%rax
movsd  -0xa0(%rbp,%rax,8),%xmm0
ff ff
call   1050 <vlistDefVarScalefactor@plt>
mov    -0x4(%rbp),%edi
mov    -0xd8(%rbp),%esi
movslq -0xd4(%rbp),%rax
movsd  -0xd0(%rbp,%rax,8),%xmm0
ff ff
call   1080 <vlistDefVarAddoffset@plt>
mov    -0xd4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xd4(%rbp)
jmp    12b2 <init_amsr_averaged+0x132>
add    $0xe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_amsr_averaged>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xb8,%rsp
lea    0xe98(%rip),%rax
mov    %rax,0x30(%rsp)
lea    0xe90(%rip),%rax
mov    %rax,0x38(%rsp)
lea    0xe89(%rip),%rax
mov    %rax,0x40(%rsp)
lea    0xe83(%rip),%rax
mov    %rax,0x48(%rsp)
lea    0xe7d(%rip),%rax
mov    %rax,0x50(%rsp)
lea    0xe76(%rip),%rax
mov    %rax,(%rsp)
lea    0xe77(%rip),%rax
mov    %rax,0x8(%rsp)
lea    0xe6f(%rip),%rax
mov    %rax,0x10(%rsp)
mov    %rax,0x18(%rsp)
lea    0xe61(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xe08(%rip),%xmm0
movaps %xmm0,0x90(%rsp)
movaps 0xe09(%rip),%xmm0
movaps %xmm0,0xa0(%rsp)
movabs $0x3fb999999999999a,%rax
99 b9 3f
mov    %rax,0xb0(%rsp)
xorps  %xmm0,%xmm0
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x70(%rsp)
movq   $0x0,0x80(%rsp)
movabs $0xc008000000000000,%rax
mov    %rax,0x60(%rsp)
test   %ecx,%ecx
jle    12dc <init_amsr_averaged+0x16c>
mov    %edx,%r14d
mov    %esi,%r15d
mov    %edi,%r13d
mov    %ecx,%r12d
xor    %ebx,%ebx
nop
mov    %r13d,%edi
mov    %r15d,%esi
mov    %r14d,%edx
mov    $0x1,%ecx
call   1030 <vlistDefVar@plt>
mov    %eax,%ebp
mov    0x30(%rsp,%rbx,8),%rdx
mov    %r13d,%edi
mov    %eax,%esi
call   1040 <vlistDefVarName@plt>
mov    (%rsp,%rbx,8),%rdx
mov    %r13d,%edi
mov    %ebp,%esi
call   1080 <vlistDefVarUnits@plt>
mov    %r13d,%edi
mov    %ebp,%esi
mov    $0xd8,%edx
call   1060 <vlistDefVarDatatype@plt>
mov    %r13d,%edi
mov    %ebp,%esi
mov    $0xfe,%edx
call   1090 <vlistDefVarMissval@plt>
movsd  0x90(%rsp,%rbx,8),%xmm0
mov    %r13d,%edi
mov    %ebp,%esi
call   1050 <vlistDefVarScalefactor@plt>
movsd  0x60(%rsp,%rbx,8),%xmm0
mov    %r13d,%edi
mov    %ebp,%esi
call   1070 <vlistDefVarAddoffset@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1260 <init_amsr_averaged+0xf0>
add    $0xb8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"sst\00"
@.str.1 = [5 x i8] c"wind\00"
@.str.2 = [6 x i8] c"vapor\00"
@.str.3 = [6 x i8] c"cloud\00"
@.str.4 = [5 x i8] c"rain\00"
@.str.5 = [12 x i8] c"deg Celcius\00"
@.str.6 = [4 x i8] c"m/s\00"
@.str.7 = [3 x i8] c"mm\00"
@.str.8 = [5 x i8] c"mm/h\00"
define void @init_amsr_averaged(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca [5 x i8*]
%10 = alloca [5 x i8*]
%11 = alloca [5 x double]
%12 = alloca [5 x double]
%13 = alloca i32
%14 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%15 = bitcast [5 x i8*]* %9 to i8*
%16 = bitcast i8* %15 to [5 x i8*]*
%17 = getelementptr inbounds [5 x i8*], [5 x i8*]* %16, i32 0, i32 0
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), i8** %17
%18 = getelementptr inbounds [5 x i8*], [5 x i8*]* %16, i32 0, i32 1
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i32 0, i32 0), i8** %18
%19 = getelementptr inbounds [5 x i8*], [5 x i8*]* %16, i32 0, i32 2
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i32 0, i32 0), i8** %19
%20 = getelementptr inbounds [5 x i8*], [5 x i8*]* %16, i32 0, i32 3
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i32 0, i32 0), i8** %20
%21 = getelementptr inbounds [5 x i8*], [5 x i8*]* %16, i32 0, i32 4
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i32 0, i32 0), i8** %21
%22 = bitcast [5 x i8*]* %10 to i8*
%23 = bitcast i8* %22 to [5 x i8*]*
%24 = getelementptr inbounds [5 x i8*], [5 x i8*]* %23, i32 0, i32 0
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i32 0, i32 0), i8** %24
%25 = getelementptr inbounds [5 x i8*], [5 x i8*]* %23, i32 0, i32 1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i32 0, i32 0), i8** %25
%26 = getelementptr inbounds [5 x i8*], [5 x i8*]* %23, i32 0, i32 2
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i32 0, i32 0), i8** %26
%27 = getelementptr inbounds [5 x i8*], [5 x i8*]* %23, i32 0, i32 3
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i32 0, i32 0), i8** %27
%28 = getelementptr inbounds [5 x i8*], [5 x i8*]* %23, i32 0, i32 4
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i32 0, i32 0), i8** %28
%29 = bitcast [5 x double]* %11 to i8*
%30 = bitcast i8* %29 to [5 x double]*
%31 = getelementptr inbounds [5 x double], [5 x double]* %30, i32 0, i32 0
store double 1.500000e-01, double* %31
%32 = getelementptr inbounds [5 x double], [5 x double]* %30, i32 0, i32 1
store double 2.000000e-01, double* %32
%33 = getelementptr inbounds [5 x double], [5 x double]* %30, i32 0, i32 2
store double 3.000000e-01, double* %33
%34 = getelementptr inbounds [5 x double], [5 x double]* %30, i32 0, i32 3
store double 1.000000e-02, double* %34
%35 = getelementptr inbounds [5 x double], [5 x double]* %30, i32 0, i32 4
store double 1.000000e-01, double* %35
%36 = bitcast [5 x double]* %12 to i8*
%37 = bitcast i8* %36 to [5 x double]*
%38 = getelementptr inbounds [5 x double], [5 x double]* %37, i32 0, i32 0
store double -3.000000e+00, double* %38
store i32 0, i32* %13
br label %39
39: ; preds = %82, %4
%40 = load i32, i32* %13
%41 = load i32, i32* %8
%42 = icmp slt i32 %40, %41
br i1 %42, label %43, label %85
43: ; preds = %39
%44 = load i32, i32* %5
%45 = load i32, i32* %6
%46 = load i32, i32* %7
%47 = call i32 @vlistDefVar(i32 %44, i32 %45, i32 %46, i32 1)
store i32 %47, i32* %14
%48 = load i32, i32* %5
%49 = load i32, i32* %14
%50 = load i32, i32* %13
%51 = sext i32 %50 to i64
%52 = getelementptr inbounds [5 x i8*], [5 x i8*]* %9, i64 0, i64 %51
%53 = load i8*, i8** %52
%54 = call i32 @vlistDefVarName(i32 %48, i32 %49, i8* %53)
%55 = load i32, i32* %5
%56 = load i32, i32* %14
%57 = load i32, i32* %13
%58 = sext i32 %57 to i64
%59 = getelementptr inbounds [5 x i8*], [5 x i8*]* %10, i64 0, i64 %58
%60 = load i8*, i8** %59
%61 = call i32 @vlistDefVarUnits(i32 %55, i32 %56, i8* %60)
%62 = load i32, i32* %5
%63 = load i32, i32* %14
%64 = call i32 @vlistDefVarDatatype(i32 %62, i32 %63, i32 216)
%65 = load i32, i32* %5
%66 = load i32, i32* %14
%67 = call i32 @vlistDefVarMissval(i32 %65, i32 %66, i32 254)
%68 = load i32, i32* %5
%69 = load i32, i32* %14
%70 = load i32, i32* %13
%71 = sext i32 %70 to i64
%72 = getelementptr inbounds [5 x double], [5 x double]* %11, i64 0, i64 %71
%73 = load double, double* %72
%74 = call i32 @vlistDefVarScalefactor(i32 %68, i32 %69, double %73)
%75 = load i32, i32* %5
%76 = load i32, i32* %14
%77 = load i32, i32* %13
%78 = sext i32 %77 to i64
%79 = getelementptr inbounds [5 x double], [5 x double]* %12, i64 0, i64 %78
%80 = load double, double* %79
%81 = call i32 @vlistDefVarAddoffset(i32 %75, i32 %76, double %80)
br label %82
82: ; preds = %43
%83 = load i32, i32* %13
%84 = add nsw i32 %83, 1
store i32 %84, i32* %13
br label %39
85: ; preds = %39
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"sst\00"
@.str.1 = [5 x i8] c"wind\00"
@.str.2 = [6 x i8] c"vapor\00"
@.str.3 = [6 x i8] c"cloud\00"
@.str.4 = [5 x i8] c"rain\00"
@.str.5 = [12 x i8] c"deg Celcius\00"
@.str.6 = [4 x i8] c"m/s\00"
@.str.7 = [3 x i8] c"mm\00"
@.str.8 = [5 x i8] c"mm/h\00"
define void @init_amsr_averaged(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca [5 x i8*]
%6 = alloca [5 x i8*]
%7 = alloca [5 x double]
%8 = alloca [5 x double]
%9 = bitcast [5 x i8*]* %5 to i8*
%10 = getelementptr inbounds [5 x i8*], [5 x i8*]* %5, i64 0, i64 0
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8** %10
%11 = getelementptr inbounds [5 x i8*], [5 x i8*]* %5, i64 0, i64 1
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8** %11
%12 = getelementptr inbounds [5 x i8*], [5 x i8*]* %5, i64 0, i64 2
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8** %12
%13 = getelementptr inbounds [5 x i8*], [5 x i8*]* %5, i64 0, i64 3
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8** %13
%14 = getelementptr inbounds [5 x i8*], [5 x i8*]* %5, i64 0, i64 4
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i8** %14
%15 = bitcast [5 x i8*]* %6 to i8*
%16 = getelementptr inbounds [5 x i8*], [5 x i8*]* %6, i64 0, i64 0
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0), i8** %16
%17 = getelementptr inbounds [5 x i8*], [5 x i8*]* %6, i64 0, i64 1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i8** %17
%18 = getelementptr inbounds [5 x i8*], [5 x i8*]* %6, i64 0, i64 2
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i8** %18
%19 = getelementptr inbounds [5 x i8*], [5 x i8*]* %6, i64 0, i64 3
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i8** %19
%20 = getelementptr inbounds [5 x i8*], [5 x i8*]* %6, i64 0, i64 4
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0), i8** %20
%21 = bitcast [5 x double]* %7 to i8*
%22 = bitcast [5 x double]* %7 to <2 x double>*
store <2 x double> <double 1.500000e-01, double 2.000000e-01>, <2 x double>* %22
%23 = getelementptr inbounds [5 x double], [5 x double]* %7, i64 0, i64 2
%24 = bitcast double* %23 to <2 x double>*
store <2 x double> <double 3.000000e-01, double 1.000000e-02>, <2 x double>* %24
%25 = getelementptr inbounds [5 x double], [5 x double]* %7, i64 0, i64 4
store double 1.000000e-01, double* %25
%26 = bitcast [5 x double]* %8 to i8*
%27 = getelementptr inbounds [5 x double], [5 x double]* %8, i64 0, i64 0
store double -3.000000e+00, double* %27
%28 = icmp sgt i32 %3, 0
br i1 %28, label %29, label %50
29: ; preds = %4
%30 = zext i32 %3 to i64
br label %31
31: ; preds = %29, %31
%32 = phi i64 [ 0, %29 ], [ %48, %31 ]
%33 = tail call i32 @vlistDefVar(i32 %0, i32 %1, i32 %2, i32 1)
%34 = getelementptr inbounds [5 x i8*], [5 x i8*]* %5, i64 0, i64 %32
%35 = load i8*, i8** %34
%36 = tail call i32 @vlistDefVarName(i32 %0, i32 %33, i8* %35)
%37 = getelementptr inbounds [5 x i8*], [5 x i8*]* %6, i64 0, i64 %32
%38 = load i8*, i8** %37
%39 = tail call i32 @vlistDefVarUnits(i32 %0, i32 %33, i8* %38)
%40 = tail call i32 @vlistDefVarDatatype(i32 %0, i32 %33, i32 216)
%41 = tail call i32 @vlistDefVarMissval(i32 %0, i32 %33, i32 254)
%42 = getelementptr inbounds [5 x double], [5 x double]* %7, i64 0, i64 %32
%43 = load double, double* %42
%44 = tail call i32 @vlistDefVarScalefactor(i32 %0, i32 %33, double %43)
%45 = getelementptr inbounds [5 x double], [5 x double]* %8, i64 0, i64 %32
%46 = load double, double* %45
%47 = tail call i32 @vlistDefVarAddoffset(i32 %0, i32 %33, double %46)
%48 = add nuw nsw i64 %32, 1
%49 = icmp eq i64 %48, %30
br i1 %49, label %50, label %31
50: ; preds = %31, %4
ret void
}