#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_day(int vlistID, int gridID, int zaxisID, int nvars) {
  char *name[] = {"hours", "sst", "wind", "vapor", "cloud", "rain"};
  char *units[] = {"h", "deg Celcius", "m/s", "mm", "mm", "mm/h"};
  double xscale[] = {0.1, 0.15, 0.2, 0.3, 0.01, 0.1};
  double xminval[] = {0., -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_day>:
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    $0x30,%edx
call   1070 <memset@plt>
lea    0xe82(%rip),%rax
mov    %rax,-0x40(%rbp)
lea    0xe7d(%rip),%rax
mov    %rax,-0x38(%rbp)
lea    0xe76(%rip),%rax
mov    %rax,-0x30(%rbp)
lea    0xe70(%rip),%rax
mov    %rax,-0x28(%rbp)
lea    0xe6b(%rip),%rax
mov    %rax,-0x20(%rbp)
lea    0xe66(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0x70(%rbp),%rdi
xor    %esi,%esi
mov    $0x30,%edx
call   1070 <memset@plt>
lea    0xe66(%rip),%rax
mov    %rax,-0x70(%rbp)
lea    0xe45(%rip),%rax
mov    %rax,-0x68(%rbp)
lea    0xe46(%rip),%rax
mov    %rax,-0x60(%rbp)
lea    0xe3f(%rip),%rax
mov    %rax,-0x58(%rbp)
lea    0xe34(%rip),%rax
mov    %rax,-0x50(%rbp)
lea    0xe2c(%rip),%rax
mov    %rax,-0x48(%rbp)
lea    -0xa0(%rbp),%rdi
xor    %esi,%esi
mov    $0x30,%edx
call   1070 <memset@plt>
movsd  0xdb2(%rip),%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  0xdc2(%rip),%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movsd  0xdaa(%rip),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  0xd92(%rip),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  0xd7a(%rip),%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  0xd65(%rip),%xmm0
movsd  %xmm0,-0x78(%rbp)
lea    -0xd0(%rbp),%rdi
xor    %esi,%esi
mov    $0x30,%edx
call   1070 <memset@plt>
movsd  0xd3d(%rip),%xmm0
movsd  %xmm0,-0xc8(%rbp)
ff
movl   $0x0,-0xd4(%rbp)
mov    -0xd4(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    13a7 <init_amsr_day+0x227>
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    12d5 <init_amsr_day+0x155>
add    $0xe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_amsr_day>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xc8,%rsp
lea    0xea8(%rip),%rax
mov    %rax,0x30(%rsp)
lea    0xea2(%rip),%rax
mov    %rax,0x38(%rsp)
lea    0xe9a(%rip),%rax
mov    %rax,0x40(%rsp)
lea    0xe93(%rip),%rax
mov    %rax,0x48(%rsp)
lea    0xe8d(%rip),%rax
mov    %rax,0x50(%rsp)
lea    0xe87(%rip),%rax
mov    %rax,0x58(%rsp)
lea    0xe96(%rip),%rax
mov    %rax,(%rsp)
lea    0xe75(%rip),%rax
mov    %rax,0x8(%rsp)
lea    0xe75(%rip),%rax
mov    %rax,0x10(%rsp)
lea    0xe6d(%rip),%rax
mov    %rax,0x18(%rsp)
mov    %rax,0x20(%rsp)
lea    0xe5f(%rip),%rax
mov    %rax,0x28(%rsp)
movaps 0xdf0(%rip),%xmm0
movaps %xmm0,0x90(%rsp)
movaps 0xdf1(%rip),%xmm0
movaps %xmm0,0xa0(%rsp)
movaps 0xdf2(%rip),%xmm0
movaps %xmm0,0xb0(%rsp)
xorps  %xmm0,%xmm0
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x80(%rsp)
movaps %xmm0,0x70(%rsp)
movabs $0xc008000000000000,%rax
mov    %rax,0x68(%rsp)
test   %ecx,%ecx
jle    12ec <init_amsr_day+0x17c>
mov    %edx,%r14d
mov    %esi,%r15d
mov    %edi,%r13d
mov    %ecx,%r12d
xor    %ebx,%ebx
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    1270 <init_amsr_day+0x100>
add    $0xc8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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