#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
int gen_check_auxstream_alarms(FILE *fp) {
  char *aux, *streamtype, streamno[5];
  int i;
  fprintf(fp, "! - AUX HISTORY OUTPUT\n");
  for (i = 1; i < 12; i++) {
    fprintf(fp, "#ifndef  DISABLE_ALARM_AUXHIST%d\n", i);
    fprintf(fp,
            "   IF( WRFU_AlarmIsRinging( grid%%alarms( AUXHIST%d_ALARM ), "
            "rc=rc ) ) THEN\n",
            i);
    fprintf(fp, "     CALL med_hist_out ( grid , %d, config_flags )\n", i);
    fprintf(fp,
            "     CALL WRFU_AlarmRingerOff( grid%%alarms( AUXHIST%d_ALARM ), "
            "rc=rc )\n",
            i);
    fprintf(fp, "   ENDIF\n");
    fprintf(fp, "#endif\n");
  }
  fprintf(fp, "! - AUX INPUT INPUT\n");
  for (i = 1; i < 12; i++) {
    fprintf(fp, "#ifndef  DISABLE_ALARM_AUXINPUT%d\n", i);
    fprintf(fp,
            "   IF( WRFU_AlarmIsRinging( grid%%alarms( AUXINPUT%d_ALARM ), "
            "rc=rc ) ) THEN\n",
            i);
    fprintf(fp, "     CALL med_auxinput%d_in ( grid , config_flags )\n", i);
    fprintf(fp, "     WRITE ( message , FMT='(A,A,A,i3)' )  'Input data "
                "processed for ' , &\n");
    fprintf(fp,
            "        TRIM(config_flags%%auxinput%d_inname) , ' for domain "
            "',grid%%id\n",
            i);
    fprintf(fp, "     CALL wrf_debug ( 0 , message )\n");
    fprintf(fp,
            "     CALL WRFU_AlarmRingerOff( grid%%alarms( AUXINPUT%d_ALARM ), "
            "rc=rc )\n",
            i);
    fprintf(fp, "   ENDIF\n");
    fprintf(fp, "#endif\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<gen_check_auxstream_alarms>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
movl   $0x1,-0x24(%rbp)
cmpl   $0xc,-0x24(%rbp)
jge    11c5 <gen_check_auxstream_alarms+0xb5>
mov    -0x8(%rbp),%rdi
mov    -0x24(%rbp),%edx
lea    0xecb(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x24(%rbp),%edx
lea    0xed8(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x24(%rbp),%edx
lea    0xf10(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x24(%rbp),%edx
lea    0xf2f(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xf66(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xf5e(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1135 <gen_check_auxstream_alarms+0x25>
mov    -0x8(%rbp),%rdi
lea    0xf46(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
movl   $0x1,-0x24(%rbp)
cmpl   $0xc,-0x24(%rbp)
jge    12a7 <gen_check_auxstream_alarms+0x197>
mov    -0x8(%rbp),%rdi
mov    -0x24(%rbp),%edx
lea    0xf35(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x24(%rbp),%edx
lea    0xf43(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x24(%rbp),%edx
lea    0xf7c(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xf9f(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x24(%rbp),%edx
lea    0xfd6(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0x100d(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x24(%rbp),%edx
lea    0x101d(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xe84(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xe7c(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    11de <gen_check_auxstream_alarms+0xce>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_check_auxstream_alarms>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xecb(%rip),%rdi
mov    $0x17,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1040 <fwrite@plt>
mov    $0x1,%ebp
lea    0xf34(%rip),%r12
lea    0xf61(%rip),%r13
lea    0xfa3(%rip),%r14
lea    0xfa6(%rip),%r15
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
lea    0xe9e(%rip),%rsi
mov    %ebp,%edx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    %rbx,%rdi
lea    0xead(%rip),%rsi
mov    %ebp,%edx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
mov    %ebp,%edx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    %rbx,%rdi
mov    %r13,%rsi
mov    %ebp,%edx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    $0x9,%esi
mov    $0x1,%edx
mov    %r14,%rdi
mov    %rbx,%rcx
call   1040 <fwrite@plt>
mov    $0x7,%esi
mov    $0x1,%edx
mov    %r15,%rdi
mov    %rbx,%rcx
call   1040 <fwrite@plt>
add    $0x1,%ebp
cmp    $0xc,%ebp
jne    1170 <gen_check_auxstream_alarms+0x50>
lea    0xf29(%rip),%rdi
mov    $0x14,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1040 <fwrite@plt>
mov    $0x1,%ebp
lea    0x105b(%rip),%r15
lea    0x1079(%rip),%r12
lea    0xeeb(%rip),%r13
lea    0xeee(%rip),%r14
mov    %rbx,%rdi
lea    0xf01(%rip),%rsi
mov    %ebp,%edx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    %rbx,%rdi
lea    0xf11(%rip),%rsi
mov    %ebp,%edx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    %rbx,%rdi
lea    0xf4c(%rip),%rsi
mov    %ebp,%edx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    $0x4b,%esi
mov    $0x1,%edx
lea    0xf67(%rip),%rdi
mov    %rbx,%rcx
call   1040 <fwrite@plt>
mov    %rbx,%rdi
lea    0xfa1(%rip),%rsi
mov    %ebp,%edx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    $0x24,%esi
mov    $0x1,%edx
mov    %r15,%rdi
mov    %rbx,%rcx
call   1040 <fwrite@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
mov    %ebp,%edx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    $0x9,%esi
mov    $0x1,%edx
mov    %r13,%rdi
mov    %rbx,%rcx
call   1040 <fwrite@plt>
mov    $0x7,%esi
mov    $0x1,%edx
mov    %r14,%rdi
mov    %rbx,%rcx
call   1040 <fwrite@plt>
add    $0x1,%ebp
cmp    $0xc,%ebp
jne    1220 <gen_check_auxstream_alarms+0x100>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [24 x i8] c"! - AUX HISTORY OUTPUT\0A\00"
@.str.1 = [34 x i8] c"#ifndef DISABLE_ALARM_AUXHIST%d\0A\00"
@.str.2 = [77 x i8] c" IF( WRFU_AlarmIsRinging( grid%%alarms( AUXHIST%d_ALARM ), rc=rc ) ) THEN\0A\00"
@.str.3 = [52 x i8] c" CALL med_hist_out ( grid , %d, config_flags )\0A\00"
@.str.4 = [73 x i8] c" CALL WRFU_AlarmRingerOff( grid%%alarms( AUXHIST%d_ALARM ), rc=rc )\0A\00"
@.str.5 = [10 x i8] c" ENDIF\0A\00"
@.str.6 = [8 x i8] c"#endif\0A\00"
@.str.7 = [21 x i8] c"! - AUX INPUT INPUT\0A\00"
@.str.8 = [35 x i8] c"#ifndef DISABLE_ALARM_AUXINPUT%d\0A\00"
@.str.9 = [78 x i8] c" IF( WRFU_AlarmIsRinging( grid%%alarms( AUXINPUT%d_ALARM ), rc=rc ) ) THEN\0A\00"
@.str.10 = [53 x i8] c" CALL med_auxinput%d_in ( grid , config_flags )\0A\00"
@.str.11 = [76 x i8] c" WRITE ( message , FMT='(A,A,A,i3)' ) 'Input data processed for ' , &\0A\00"
@.str.12 = [73 x i8] c" TRIM(config_flags%%auxinput%d_inname) , ' for domain ',grid%%id\0A\00"
@.str.13 = [37 x i8] c" CALL wrf_debug ( 0 , message )\0A\00"
@.str.14 = [74 x i8] c" CALL WRFU_AlarmRingerOff( grid%%alarms( AUXINPUT%d_ALARM ), rc=rc )\0A\00"
define i32 @gen_check_auxstream_alarms(i32* %0) {
%2 = alloca i32*
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [5 x i8]
%6 = alloca i32
store i32* %0, i32** %2
%7 = load i32*, i32** %2
%8 = call i32 (i32*, i8*, ...) @fprintf(i32* %7, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %6
br label %9
9: ; preds = %29, %1
%10 = load i32, i32* %6
%11 = icmp slt i32 %10, 12
br i1 %11, label %12, label %32
12: ; preds = %9
%13 = load i32*, i32** %2
%14 = load i32, i32* %6
%15 = call i32 (i32*, i8*, ...) @fprintf(i32* %13, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), i32 %14)
%16 = load i32*, i32** %2
%17 = load i32, i32* %6
%18 = call i32 (i32*, i8*, ...) @fprintf(i32* %16, i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str.2, i64 0, i64 0), i32 %17)
%19 = load i32*, i32** %2
%20 = load i32, i32* %6
%21 = call i32 (i32*, i8*, ...) @fprintf(i32* %19, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.3, i64 0, i64 0), i32 %20)
%22 = load i32*, i32** %2
%23 = load i32, i32* %6
%24 = call i32 (i32*, i8*, ...) @fprintf(i32* %22, i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str.4, i64 0, i64 0), i32 %23)
%25 = load i32*, i32** %2
%26 = call i32 (i32*, i8*, ...) @fprintf(i32* %25, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0))
%27 = load i32*, i32** %2
%28 = call i32 (i32*, i8*, ...) @fprintf(i32* %27, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0))
br label %29
29: ; preds = %12
%30 = load i32, i32* %6
%31 = add nsw i32 %30, 1
store i32 %31, i32* %6
br label %9
32: ; preds = %9
%33 = load i32*, i32** %2
%34 = call i32 (i32*, i8*, ...) @fprintf(i32* %33, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.7, i64 0, i64 0))
store i32 1, i32* %6
br label %35
35: ; preds = %62, %32
%36 = load i32, i32* %6
%37 = icmp slt i32 %36, 12
br i1 %37, label %38, label %65
38: ; preds = %35
%39 = load i32*, i32** %2
%40 = load i32, i32* %6
%41 = call i32 (i32*, i8*, ...) @fprintf(i32* %39, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.8, i64 0, i64 0), i32 %40)
%42 = load i32*, i32** %2
%43 = load i32, i32* %6
%44 = call i32 (i32*, i8*, ...) @fprintf(i32* %42, i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str.9, i64 0, i64 0), i32 %43)
%45 = load i32*, i32** %2
%46 = load i32, i32* %6
%47 = call i32 (i32*, i8*, ...) @fprintf(i32* %45, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.10, i64 0, i64 0), i32 %46)
%48 = load i32*, i32** %2
%49 = call i32 (i32*, i8*, ...) @fprintf(i32* %48, i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str.11, i64 0, i64 0))
%50 = load i32*, i32** %2
%51 = load i32, i32* %6
%52 = call i32 (i32*, i8*, ...) @fprintf(i32* %50, i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str.12, i64 0, i64 0), i32 %51)
%53 = load i32*, i32** %2
%54 = call i32 (i32*, i8*, ...) @fprintf(i32* %53, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.13, i64 0, i64 0))
%55 = load i32*, i32** %2
%56 = load i32, i32* %6
%57 = call i32 (i32*, i8*, ...) @fprintf(i32* %55, i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str.14, i64 0, i64 0), i32 %56)
%58 = load i32*, i32** %2
%59 = call i32 (i32*, i8*, ...) @fprintf(i32* %58, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0))
%60 = load i32*, i32** %2
%61 = call i32 (i32*, i8*, ...) @fprintf(i32* %60, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0))
br label %62
62: ; preds = %38
%63 = load i32, i32* %6
%64 = add nsw i32 %63, 1
store i32 %64, i32* %6
br label %35
65: ; preds = %35
ret i32 0
}

LLVM IR (-O2):
@.str = [24 x i8] c"! - AUX HISTORY OUTPUT\0A\00"
@.str.1 = [34 x i8] c"#ifndef DISABLE_ALARM_AUXHIST%d\0A\00"
@.str.2 = [77 x i8] c" IF( WRFU_AlarmIsRinging( grid%%alarms( AUXHIST%d_ALARM ), rc=rc ) ) THEN\0A\00"
@.str.3 = [52 x i8] c" CALL med_hist_out ( grid , %d, config_flags )\0A\00"
@.str.4 = [73 x i8] c" CALL WRFU_AlarmRingerOff( grid%%alarms( AUXHIST%d_ALARM ), rc=rc )\0A\00"
@.str.5 = [10 x i8] c" ENDIF\0A\00"
@.str.6 = [8 x i8] c"#endif\0A\00"
@.str.7 = [21 x i8] c"! - AUX INPUT INPUT\0A\00"
@.str.8 = [35 x i8] c"#ifndef DISABLE_ALARM_AUXINPUT%d\0A\00"
@.str.9 = [78 x i8] c" IF( WRFU_AlarmIsRinging( grid%%alarms( AUXINPUT%d_ALARM ), rc=rc ) ) THEN\0A\00"
@.str.10 = [53 x i8] c" CALL med_auxinput%d_in ( grid , config_flags )\0A\00"
@.str.11 = [76 x i8] c" WRITE ( message , FMT='(A,A,A,i3)' ) 'Input data processed for ' , &\0A\00"
@.str.12 = [73 x i8] c" TRIM(config_flags%%auxinput%d_inname) , ' for domain ',grid%%id\0A\00"
@.str.13 = [37 x i8] c" CALL wrf_debug ( 0 , message )\0A\00"
@.str.14 = [74 x i8] c" CALL WRFU_AlarmRingerOff( grid%%alarms( AUXINPUT%d_ALARM ), rc=rc )\0A\00"
define i32 @gen_check_auxstream_alarms(i32* nocapture %0) {
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i64 23, i64 1, i32* %0)
br label %3
3: ; preds = %1, %3
%4 = phi i32 [ 1, %1 ], [ %11, %3 ]
%5 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), i32 %4)
%6 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str.2, i64 0, i64 0), i32 %4)
%7 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.3, i64 0, i64 0), i32 %4)
%8 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str.4, i64 0, i64 0), i32 %4)
%9 = tail call i64 @fwrite(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0), i64 9, i64 1, i32* %0)
%10 = tail call i64 @fwrite(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0), i64 7, i64 1, i32* %0)
%11 = add nuw nsw i32 %4, 1
%12 = icmp eq i32 %11, 12
br i1 %12, label %13, label %3
13: ; preds = %3
%14 = tail call i64 @fwrite(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.7, i64 0, i64 0), i64 20, i64 1, i32* %0)
br label %15
15: ; preds = %13, %15
%16 = phi i32 [ 1, %13 ], [ %26, %15 ]
%17 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.8, i64 0, i64 0), i32 %16)
%18 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str.9, i64 0, i64 0), i32 %16)
%19 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.10, i64 0, i64 0), i32 %16)
%20 = tail call i64 @fwrite(i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str.11, i64 0, i64 0), i64 75, i64 1, i32* %0)
%21 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str.12, i64 0, i64 0), i32 %16)
%22 = tail call i64 @fwrite(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.13, i64 0, i64 0), i64 36, i64 1, i32* %0)
%23 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str.14, i64 0, i64 0), i32 %16)
%24 = tail call i64 @fwrite(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0), i64 9, i64 1, i32* %0)
%25 = tail call i64 @fwrite(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0), i64 7, i64 1, i32* %0)
%26 = add nuw nsw i32 %16, 1
%27 = icmp eq i32 %26, 12
br i1 %27, label %28, label %15
28: ; preds = %15
ret i32 0
}