#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*/ vlistDefVarCode(int, int, int);
int /*<<< orphan*/ vlistDefVarDatatype(int, int, int);
int /*<<< orphan*/ vlistDefVarName(int, int, char *);
int /*<<< orphan*/ vlistDefVarUnits(int, int, char *);
void init_vars(int vlistID, int gridID, int zaxisID, int nvars) {
  int code[] = {11, 17, 33, 34, 1, 2};
  char *name[] = {"temp", "depoint", "u", "v", "height", "pressure"};
  char *units[] = {"Celsius", "", "m/s", "m/s", "m", "hPa"};
  int i, varID;
  for (i = 0; i < nvars; ++i) {
    varID = vlistDefVar(vlistID, gridID, zaxisID, 1);
    vlistDefVarCode(vlistID, varID, code[i]);
    vlistDefVarName(vlistID, varID, name[i]);
    vlistDefVarUnits(vlistID, varID, units[i]);
    vlistDefVarDatatype(vlistID, varID, 132);
  }
}


x86 assembly (clang, -O0):
<init_vars>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    0xe82(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xe7f(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xe7c(%rip),%rax
mov    %rax,-0x20(%rbp)
lea    -0x60(%rbp),%rdi
xor    %esi,%esi
mov    $0x30,%edx
call   1060 <memset@plt>
lea    0xe69(%rip),%rax
mov    %rax,-0x60(%rbp)
lea    0xe63(%rip),%rax
mov    %rax,-0x58(%rbp)
lea    0xe60(%rip),%rax
mov    %rax,-0x50(%rbp)
lea    0xe57(%rip),%rax
mov    %rax,-0x48(%rbp)
lea    0xe4e(%rip),%rax
mov    %rax,-0x40(%rbp)
lea    0xe4a(%rip),%rax
mov    %rax,-0x38(%rbp)
lea    -0x90(%rbp),%rdi
xor    %esi,%esi
mov    $0x30,%edx
call   1060 <memset@plt>
lea    0xe35(%rip),%rax
mov    %rax,-0x90(%rbp)
lea    0xe38(%rip),%rax
mov    %rax,-0x88(%rbp)
lea    0xe21(%rip),%rax
mov    %rax,-0x80(%rbp)
lea    0xe16(%rip),%rax
mov    %rax,-0x78(%rbp)
lea    0xe0f(%rip),%rax
mov    %rax,-0x70(%rbp)
lea    0xe06(%rip),%rax
mov    %rax,-0x68(%rbp)
movl   $0x0,-0x94(%rbp)
mov    -0x94(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    12ee <init_vars+0x18e>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    $0x1,%ecx
call   1030 <vlistDefVar@plt>
mov    %eax,-0x98(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x98(%rbp),%esi
movslq -0x94(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%edx
call   1080 <vlistDefVarCode@plt>
mov    -0x4(%rbp),%edi
mov    -0x98(%rbp),%esi
movslq -0x94(%rbp),%rax
mov    -0x60(%rbp,%rax,8),%rdx
call   1040 <vlistDefVarName@plt>
mov    -0x4(%rbp),%edi
mov    -0x98(%rbp),%esi
movslq -0x94(%rbp),%rax
mov    -0x90(%rbp,%rax,8),%rdx
ff
call   1070 <vlistDefVarUnits@plt>
mov    -0x4(%rbp),%edi
mov    -0x98(%rbp),%esi
mov    $0x84,%edx
call   1050 <vlistDefVarDatatype@plt>
mov    -0x94(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x94(%rbp)
jmp    124f <init_vars+0xef>
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_vars>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x68,%rsp
lea    0xeb3(%rip),%rax
mov    %rax,0x30(%rsp)
lea    0xeac(%rip),%rax
mov    %rax,0x38(%rsp)
lea    0xea8(%rip),%rax
mov    %rax,0x40(%rsp)
lea    0xe9e(%rip),%rax
mov    %rax,0x48(%rsp)
lea    0xe94(%rip),%rax
mov    %rax,0x50(%rsp)
lea    0xe8f(%rip),%rax
mov    %rax,0x58(%rsp)
lea    0xe8c(%rip),%rax
mov    %rax,(%rsp)
lea    0xe92(%rip),%rax
mov    %rax,0x8(%rsp)
lea    0xe7d(%rip),%rax
mov    %rax,0x10(%rsp)
mov    %rax,0x18(%rsp)
lea    0xe70(%rip),%rax
mov    %rax,0x20(%rsp)
lea    0xe66(%rip),%rax
mov    %rax,0x28(%rsp)
test   %ecx,%ecx
jle    125e <init_vars+0x10e>
mov    %edx,%r14d
mov    %esi,%r15d
mov    %edi,%r13d
mov    %ecx,%r12d
shl    $0x2,%r12
xor    %ebx,%ebx
nopl   0x0(%rax)
mov    %r13d,%edi
mov    %r15d,%esi
mov    %r14d,%edx
mov    $0x1,%ecx
call   1030 <vlistDefVar@plt>
mov    %eax,%ebp
lea    0xde4(%rip),%rax
mov    (%rbx,%rax,1),%edx
mov    %r13d,%edi
mov    %ebp,%esi
call   1070 <vlistDefVarCode@plt>
mov    0x30(%rsp,%rbx,2),%rdx
mov    %r13d,%edi
mov    %ebp,%esi
call   1040 <vlistDefVarName@plt>
mov    (%rsp,%rbx,2),%rdx
mov    %r13d,%edi
mov    %ebp,%esi
call   1060 <vlistDefVarUnits@plt>
mov    %r13d,%edi
mov    %ebp,%esi
mov    $0x84,%edx
call   1050 <vlistDefVarDatatype@plt>
add    $0x4,%rbx
cmp    %rbx,%r12
jne    1200 <init_vars+0xb0>
add    $0x68,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@__const.init_vars.code = [6 x i32] [i32 11, i32 17, i32 33, i32 34, i32 1, i32 2]
@.str = [5 x i8] c"temp\00"
@.str.1 = [8 x i8] c"depoint\00"
@.str.2 = [2 x i8] c"u\00"
@.str.3 = [2 x i8] c"v\00"
@.str.4 = [7 x i8] c"height\00"
@.str.5 = [9 x i8] c"pressure\00"
@.str.6 = [8 x i8] c"Celsius\00"
@.str.7 = [1 x i8] zeroinitializer
@.str.8 = [4 x i8] c"m/s\00"
@.str.9 = [2 x i8] c"m\00"
@.str.10 = [4 x i8] c"hPa\00"
define void @init_vars(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca [6 x i32]
%10 = alloca [6 x i8*]
%11 = alloca [6 x i8*]
%12 = alloca i32
%13 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%14 = bitcast [6 x i32]* %9 to i8*
%15 = bitcast [6 x i8*]* %10 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 ([5 x i8], [5 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 ([8 x i8], [8 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 ([2 x i8], [2 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 ([2 x i8], [2 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 ([7 x i8], [7 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 ([9 x i8], [9 x i8]* @.str.5, i32 0, i32 0), i8** %22
%23 = bitcast [6 x i8*]* %11 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 ([8 x i8], [8 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 ([1 x i8], [1 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 ([4 x i8], [4 x i8]* @.str.8, i32 0, i32 0), i8** %28
%29 = getelementptr inbounds [6 x i8*], [6 x i8*]* %24, i32 0, i32 4
store i8* getelementptr inbounds ([2 x i8], [2 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 ([4 x i8], [4 x i8]* @.str.10, i32 0, i32 0), i8** %30
store i32 0, i32* %12
br label %31
31: ; preds = %64, %4
%32 = load i32, i32* %12
%33 = load i32, i32* %8
%34 = icmp slt i32 %32, %33
br i1 %34, label %35, label %67
35: ; preds = %31
%36 = load i32, i32* %5
%37 = load i32, i32* %6
%38 = load i32, i32* %7
%39 = call i32 @vlistDefVar(i32 %36, i32 %37, i32 %38, i32 1)
store i32 %39, i32* %13
%40 = load i32, i32* %5
%41 = load i32, i32* %13
%42 = load i32, i32* %12
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds [6 x i32], [6 x i32]* %9, i64 0, i64 %43
%45 = load i32, i32* %44
%46 = call i32 @vlistDefVarCode(i32 %40, i32 %41, i32 %45)
%47 = load i32, i32* %5
%48 = load i32, i32* %13
%49 = load i32, i32* %12
%50 = sext i32 %49 to i64
%51 = getelementptr inbounds [6 x i8*], [6 x i8*]* %10, i64 0, i64 %50
%52 = load i8*, i8** %51
%53 = call i32 @vlistDefVarName(i32 %47, i32 %48, i8* %52)
%54 = load i32, i32* %5
%55 = load i32, i32* %13
%56 = load i32, i32* %12
%57 = sext i32 %56 to i64
%58 = getelementptr inbounds [6 x i8*], [6 x i8*]* %11, i64 0, i64 %57
%59 = load i8*, i8** %58
%60 = call i32 @vlistDefVarUnits(i32 %54, i32 %55, i8* %59)
%61 = load i32, i32* %5
%62 = load i32, i32* %13
%63 = call i32 @vlistDefVarDatatype(i32 %61, i32 %62, i32 132)
br label %64
64: ; preds = %35
%65 = load i32, i32* %12
%66 = add nsw i32 %65, 1
store i32 %66, i32* %12
br label %31
67: ; preds = %31
ret void
}

LLVM IR (-O2):
@__const.init_vars.code = [6 x i32] [i32 11, i32 17, i32 33, i32 34, i32 1, i32 2]
@.str = [5 x i8] c"temp\00"
@.str.1 = [8 x i8] c"depoint\00"
@.str.2 = [2 x i8] c"u\00"
@.str.3 = [2 x i8] c"v\00"
@.str.4 = [7 x i8] c"height\00"
@.str.5 = [9 x i8] c"pressure\00"
@.str.6 = [8 x i8] c"Celsius\00"
@.str.7 = [1 x i8] zeroinitializer
@.str.8 = [4 x i8] c"m/s\00"
@.str.9 = [2 x i8] c"m\00"
@.str.10 = [4 x i8] c"hPa\00"
define void @init_vars(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca [6 x i8*]
%6 = alloca [6 x i8*]
%7 = bitcast [6 x i8*]* %5 to i8*
%8 = getelementptr inbounds [6 x i8*], [6 x i8*]* %5, i64 0, i64 0
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8** %8
%9 = getelementptr inbounds [6 x i8*], [6 x i8*]* %5, i64 0, i64 1
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8** %9
%10 = getelementptr inbounds [6 x i8*], [6 x i8*]* %5, i64 0, i64 2
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i8** %10
%11 = getelementptr inbounds [6 x i8*], [6 x i8*]* %5, i64 0, i64 3
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i8** %11
%12 = getelementptr inbounds [6 x i8*], [6 x i8*]* %5, i64 0, i64 4
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i8** %12
%13 = getelementptr inbounds [6 x i8*], [6 x i8*]* %5, i64 0, i64 5
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0), i8** %13
%14 = bitcast [6 x i8*]* %6 to i8*
%15 = getelementptr inbounds [6 x i8*], [6 x i8*]* %6, i64 0, i64 0
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0), i8** %15
%16 = getelementptr inbounds [6 x i8*], [6 x i8*]* %6, i64 0, i64 1
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.7, i64 0, i64 0), i8** %16
%17 = 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** %17
%18 = getelementptr inbounds [6 x i8*], [6 x i8*]* %6, i64 0, i64 3
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0), i8** %18
%19 = getelementptr inbounds [6 x i8*], [6 x i8*]* %6, i64 0, i64 4
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0), i8** %19
%20 = getelementptr inbounds [6 x i8*], [6 x i8*]* %6, i64 0, i64 5
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0), i8** %20
%21 = icmp sgt i32 %3, 0
br i1 %21, label %22, label %39
22: ; preds = %4
%23 = zext i32 %3 to i64
br label %24
24: ; preds = %22, %24
%25 = phi i64 [ 0, %22 ], [ %37, %24 ]
%26 = tail call i32 @vlistDefVar(i32 %0, i32 %1, i32 %2, i32 1)
%27 = getelementptr inbounds [6 x i32], [6 x i32]* @__const.init_vars.code, i64 0, i64 %25
%28 = load i32, i32* %27
%29 = tail call i32 @vlistDefVarCode(i32 %0, i32 %26, i32 %28)
%30 = getelementptr inbounds [6 x i8*], [6 x i8*]* %5, i64 0, i64 %25
%31 = load i8*, i8** %30
%32 = tail call i32 @vlistDefVarName(i32 %0, i32 %26, i8* %31)
%33 = getelementptr inbounds [6 x i8*], [6 x i8*]* %6, i64 0, i64 %25
%34 = load i8*, i8** %33
%35 = tail call i32 @vlistDefVarUnits(i32 %0, i32 %26, i8* %34)
%36 = tail call i32 @vlistDefVarDatatype(i32 %0, i32 %26, i32 132)
%37 = add nuw nsw i64 %25, 1
%38 = icmp eq i64 %37, %23
br i1 %38, label %39, label %24
39: ; preds = %24, %4
ret void
}