#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 */
scalar_t__ atoi(char *);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ usage(char *);
int main(int argc, char *argv[]) {
  FILE *outFile;
  unsigned int id_min, id_max;
  unsigned int i;
  if (argc != 4) {
    usage(argv[0]);
    return -1;
  }
  id_min = (unsigned int)atoi(argv[1]);
  id_max = (unsigned int)atoi(argv[2]);
  if (id_min > id_max) {
    fprintf(stderr,
            "ERROR: Min ID %u cannot be strictly greater than Max ID %u !\n",
            id_min, id_max);
    return -1;
  }
  outFile = fopen(argv[3], "wb");
  if (!outFile) {
    fprintf(stderr, "ERROR: Could not create output file '%s'.\n", argv[3]);
    return -1;
  }
  fprintf(
      outFile,
      ";/*"
      "\r\n"
      "; * %s"
      "\r\n"
      "; * Contains event message string templates for the EventCreate Command."
      "\r\n"
      "; *"
      "\r\n"
      "; * This file is autogenerated, do not edit."
      "\r\n"
      "; * Generated with:"
      "\r\n"
      "; *   %s %u %u %s"
      "\r\n"
      "; */"
      "\r\n"
      "\r\n"
      "LanguageNames=(Neutral=0x0000:MSG00000)"
      "\r\n"
      "MessageIdTypedef=DWORD"
      "\r\n"
      "\r\n",
      argv[3], argv[0], id_min, id_max, argv[3]);
  for (i = id_min; i <= id_max; ++i) {
    fprintf(outFile,
            "MessageId=0x%X"
            "\r\n"
            "Language=Neutral"
            "\r\n"
            "%%1"
            "\r\n"
            "."
            "\r\n"
            "\r\n",
            i);
  }
  fclose(outFile);
  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)
cmpl   $0x4,-0x8(%rbp)
je     1188 <main+0x38>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1050 <usage@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    12a7 <main+0x157>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1070 <atoi@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1070 <atoi@plt>
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jbe    11de <main+0x8e>
mov    0x2e25(%rip),%rax
movslq (%rax),%rdi
mov    -0x1c(%rbp),%edx
mov    -0x20(%rbp),%ecx
lea    0xe35(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    12a7 <main+0x157>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
lea    0xe51(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    122d <main+0xdd>
mov    0x2dd8(%rip),%rax
movslq (%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdx
lea    0xe27(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    12a7 <main+0x157>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdx
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
mov    -0x1c(%rbp),%r8d
mov    -0x20(%rbp),%r9d
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rax
lea    0xe15(%rip),%rsi
mov    %rax,(%rsp)
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x20(%rbp),%eax
ja     1297 <main+0x147>
mov    -0x18(%rbp),%rdi
mov    -0x24(%rbp),%edx
lea    0xee8(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1268 <main+0x118>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r12
cmp    $0x4,%edi
jne    119e <main+0x4e>
mov    0x8(%r12),%rdi
call   1070 <atoi@plt>
mov    %rax,%rbx
mov    0x10(%r12),%rdi
call   1070 <atoi@plt>
mov    %rax,%r14
cmp    %r14d,%ebx
jbe    11b8 <main+0x68>
mov    0x2e5a(%rip),%rax
movslq (%rax),%rdi
lea    0xe70(%rip),%rsi
mov    %ebx,%edx
mov    %r14d,%ecx
xor    %eax,%eax
call   1040 <fprintf@plt>
jmp    11a7 <main+0x57>
mov    (%r12),%rdi
call   1050 <usage@plt>
mov    $0xffffffff,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret
mov    0x18(%r12),%rdi
lea    0xe7a(%rip),%rsi
call   1060 <fopen@plt>
test   %rax,%rax
je     1223 <main+0xd3>
mov    %rax,%r15
mov    (%r12),%rcx
mov    0x18(%r12),%rdx
mov    %rdx,(%rsp)
lea    0xe87(%rip),%rsi
mov    %rax,%rdi
mov    %ebx,%r8d
mov    %r14d,%r9d
xor    %eax,%eax
call   1040 <fprintf@plt>
lea    0xf6e(%rip),%r12
nopl   0x0(%rax)
mov    %r15,%rdi
mov    %r12,%rsi
mov    %ebx,%edx
xor    %eax,%eax
call   1040 <fprintf@plt>
add    $0x1,%ebx
cmp    %r14d,%ebx
jbe    1200 <main+0xb0>
mov    %r15,%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
jmp    11ac <main+0x5c>
mov    0x2db6(%rip),%rax
movslq (%rax),%rdi
mov    0x18(%r12),%rdx
lea    0xe08(%rip),%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
jmp    11a7 <main+0x57>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [62 x i8] c"ERROR: Min ID %u cannot be strictly greater than Max ID %u !\0A\00"
@.str.1 = [3 x i8] c"wb\00"
@.str.2 = [43 x i8] c"ERROR: Could not create output file '%s'.\0A\00"
@.str.3 = [254 x i8] c";/*\0D\0A; * %s\0D\0A; * Contains event message string templates for the EventCreate Command.\0D\0A; *\0D\0A; * This file is autogenerated, do not edit.\0D\0A; * Generated with:\0D\0A; * %s %u %u %s\0D\0A; */\0D\0A\0D\0ALanguageNames=(Neutral=0x0000:MSG00000)\0D\0AMessageIdTypedef=DWORD\0D\0A\0D\0A\00"
@.str.4 = [45 x i8] c"MessageId=0x%X\0D\0ALanguage=Neutral\0D\0A%%1\0D\0A.\0D\0A\0D\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%10 = load i32, i32* %4
%11 = icmp ne i32 %10, 4
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 @usage(i8* %15)
store i32 -1, i32* %3
br label %82
17: ; preds = %2
%18 = load i8**, i8*** %5
%19 = getelementptr inbounds i8*, i8** %18, i64 1
%20 = load i8*, i8** %19
%21 = call i64 @atoi(i8* %20)
%22 = trunc i64 %21 to i32
store i32 %22, i32* %7
%23 = load i8**, i8*** %5
%24 = getelementptr inbounds i8*, i8** %23, i64 2
%25 = load i8*, i8** %24
%26 = call i64 @atoi(i8* %25)
%27 = trunc i64 %26 to i32
store i32 %27, i32* %8
%28 = load i32, i32* %7
%29 = load i32, i32* %8
%30 = icmp ugt i32 %28, %29
br i1 %30, label %31, label %38
31: ; preds = %17
%32 = load i32, i32* @stderr
%33 = sext i32 %32 to i64
%34 = inttoptr i64 %33 to i32*
%35 = load i32, i32* %7
%36 = load i32, i32* %8
%37 = call i32 (i32*, i8*, ...) @fprintf(i32* %34, i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0), i32 %35, i32 %36)
store i32 -1, i32* %3
br label %82
38: ; preds = %17
%39 = load i8**, i8*** %5
%40 = getelementptr inbounds i8*, i8** %39, i64 3
%41 = load i8*, i8** %40
%42 = call i32* @fopen(i8* %41, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32* %42, i32** %6
%43 = load i32*, i32** %6
%44 = icmp ne i32* %43, null
br i1 %44, label %53, label %45
45: ; preds = %38
%46 = load i32, i32* @stderr
%47 = sext i32 %46 to i64
%48 = inttoptr i64 %47 to i32*
%49 = load i8**, i8*** %5
%50 = getelementptr inbounds i8*, i8** %49, i64 3
%51 = load i8*, i8** %50
%52 = call i32 (i32*, i8*, ...) @fprintf(i32* %48, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.2, i64 0, i64 0), i8* %51)
store i32 -1, i32* %3
br label %82
53: ; preds = %38
%54 = load i32*, i32** %6
%55 = load i8**, i8*** %5
%56 = getelementptr inbounds i8*, i8** %55, i64 3
%57 = load i8*, i8** %56
%58 = load i8**, i8*** %5
%59 = getelementptr inbounds i8*, i8** %58, i64 0
%60 = load i8*, i8** %59
%61 = load i32, i32* %7
%62 = load i32, i32* %8
%63 = load i8**, i8*** %5
%64 = getelementptr inbounds i8*, i8** %63, i64 3
%65 = load i8*, i8** %64
%66 = call i32 (i32*, i8*, ...) @fprintf(i32* %54, i8* getelementptr inbounds ([254 x i8], [254 x i8]* @.str.3, i64 0, i64 0), i8* %57, i8* %60, i32 %61, i32 %62, i8* %65)
%67 = load i32, i32* %7
store i32 %67, i32* %9
br label %68
68: ; preds = %76, %53
%69 = load i32, i32* %9
%70 = load i32, i32* %8
%71 = icmp ule i32 %69, %70
br i1 %71, label %72, label %79
72: ; preds = %68
%73 = load i32*, i32** %6
%74 = load i32, i32* %9
%75 = call i32 (i32*, i8*, ...) @fprintf(i32* %73, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.4, i64 0, i64 0), i32 %74)
br label %76
76: ; preds = %72
%77 = load i32, i32* %9
%78 = add i32 %77, 1
store i32 %78, i32* %9
br label %68
79: ; preds = %68
%80 = load i32*, i32** %6
%81 = call i32 @fclose(i32* %80)
store i32 0, i32* %3
br label %82
82: ; preds = %79, %45, %31, %12
%83 = load i32, i32* %3
ret i32 %83
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [62 x i8] c"ERROR: Min ID %u cannot be strictly greater than Max ID %u !\0A\00"
@.str.1 = [3 x i8] c"wb\00"
@.str.2 = [43 x i8] c"ERROR: Could not create output file '%s'.\0A\00"
@.str.3 = [254 x i8] c";/*\0D\0A; * %s\0D\0A; * Contains event message string templates for the EventCreate Command.\0D\0A; *\0D\0A; * This file is autogenerated, do not edit.\0D\0A; * Generated with:\0D\0A; * %s %u %u %s\0D\0A; */\0D\0A\0D\0ALanguageNames=(Neutral=0x0000:MSG00000)\0D\0AMessageIdTypedef=DWORD\0D\0A\0D\0A\00"
@.str.4 = [45 x i8] c"MessageId=0x%X\0D\0ALanguage=Neutral\0D\0A%%1\0D\0A.\0D\0A\0D\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 4
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = load i8*, i8** %1
%6 = tail call i32 @usage(i8* %5)
br label %44
7: ; preds = %2
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = tail call i64 @atoi(i8* %9)
%11 = trunc i64 %10 to i32
%12 = getelementptr inbounds i8*, i8** %1, i64 2
%13 = load i8*, i8** %12
%14 = tail call i64 @atoi(i8* %13)
%15 = trunc i64 %14 to i32
%16 = icmp ugt i32 %11, %15
br i1 %16, label %17, label %22
17: ; preds = %7
%18 = load i32, i32* @stderr
%19 = sext i32 %18 to i64
%20 = inttoptr i64 %19 to i32*
%21 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %20, i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0), i32 %11, i32 %15)
br label %44
22: ; preds = %7
%23 = getelementptr inbounds i8*, i8** %1, i64 3
%24 = load i8*, i8** %23
%25 = tail call i32* @fopen(i8* %24, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%26 = icmp eq i32* %25, null
br i1 %26, label %27, label %33
27: ; preds = %22
%28 = load i32, i32* @stderr
%29 = sext i32 %28 to i64
%30 = inttoptr i64 %29 to i32*
%31 = load i8*, i8** %23
%32 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %30, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.2, i64 0, i64 0), i8* %31)
br label %44
33: ; preds = %22
%34 = load i8*, i8** %23
%35 = load i8*, i8** %1
%36 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %25, i8* getelementptr inbounds ([254 x i8], [254 x i8]* @.str.3, i64 0, i64 0), i8* %34, i8* %35, i32 %11, i32 %15, i8* %34)
br label %37
37: ; preds = %33, %37
%38 = phi i32 [ %40, %37 ], [ %11, %33 ]
%39 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %25, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.4, i64 0, i64 0), i32 %38)
%40 = add i32 %38, 1
%41 = icmp ugt i32 %40, %15
br i1 %41, label %42, label %37
42: ; preds = %37
%43 = tail call i32 @fclose(i32* %25)
br label %44
44: ; preds = %42, %27, %17, %4
%45 = phi i32 [ -1, %4 ], [ -1, %17 ], [ 0, %42 ], [ -1, %27 ]
ret i32 %45
}