#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 /*<<< orphan*/ CmdEndParagraph(int /*<<< orphan*/);
int /*<<< orphan*/ CmdIndent(int);
int /*<<< orphan*/ ConvertString(char *);
int TexFontNumber(char *);
int /*<<< orphan*/ diagnostics(int, char *, ...);
int /*<<< orphan*/ fprintRTF(char *, ...);
int /*<<< orphan*/ free(char *);
char *getTexUntil(char *, int /*<<< orphan*/);
int /*<<< orphan*/ snprintf(char *, int, char *, char *, char *, char *);
int /*<<< orphan*/ startParagraph(char *, int);
void Ignore_Environment(char *cCommand) {
  char unknown_environment[100];
  char *buffer;
  int font;
  diagnostics(4, "Entering IgnoreEnvironment <%s>", cCommand);
  snprintf(unknown_environment, 100, "\\%s%s%s", "end{", cCommand, "}");
  font = TexFontNumber("Typewriter");
  CmdEndParagraph(0);
  CmdIndent(1);
  startParagraph("Normal", 2);
  fprintRTF("\\qc [Sorry. Ignored ");
  fprintRTF("{\\plain\\f%d\\\\begin\\{%s\\} ... \\\\end\\{%s\\}}]", font,
            cCommand, cCommand);
  CmdEndParagraph(0);
  CmdIndent(2);
  buffer = getTexUntil(unknown_environment, 0);
  ConvertString(unknown_environment);
  free(buffer);
  diagnostics(4, "Exiting IgnoreEnvironment");
}


x86 assembly (clang, -O0):
<Ignore_Environment>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
mov    $0x4,%edi
lea    0xe41(%rip),%rsi
mov    $0x0,%al
call   1080 <diagnostics@plt>
lea    -0x70(%rbp),%rdi
mov    -0x8(%rbp),%r8
mov    $0x64,%esi
lea    0xe46(%rip),%rdx
lea    0xe47(%rip),%rcx
lea    0xe45(%rip),%r9
call   1060 <snprintf@plt>
lea    0xe3b(%rip),%rdi
call   1040 <TexFontNumber@plt>
mov    %eax,-0x7c(%rbp)
xor    %edi,%edi
call   10c0 <CmdEndParagraph@plt>
mov    $0x1,%edi
call   1050 <CmdIndent@plt>
lea    0xe26(%rip),%rdi
mov    $0x2,%esi
call   1090 <startParagraph@plt>
lea    0xe1c(%rip),%rdi
mov    $0x0,%al
call   10a0 <fprintRTF@plt>
mov    -0x7c(%rbp),%esi
mov    -0x8(%rbp),%rdx
mov    -0x8(%rbp),%rcx
lea    0xe18(%rip),%rdi
mov    $0x0,%al
call   10a0 <fprintRTF@plt>
xor    %edi,%edi
call   10c0 <CmdEndParagraph@plt>
mov    $0x2,%edi
call   1050 <CmdIndent@plt>
lea    -0x70(%rbp),%rdi
xor    %esi,%esi
call   10b0 <getTexUntil@plt>
mov    %rax,-0x78(%rbp)
lea    -0x70(%rbp),%rdi
call   1070 <ConvertString@plt>
mov    -0x78(%rbp),%rdi
call   1030 <free@plt>
mov    $0x4,%edi
lea    0xdfe(%rip),%rsi
mov    $0x0,%al
call   1080 <diagnostics@plt>
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Ignore_Environment>:
push   %rbp
push   %r14
push   %rbx
sub    $0x70,%rsp
mov    %rdi,%rbx
lea    0xe4e(%rip),%rsi
mov    $0x4,%edi
mov    %rbx,%rdx
xor    %eax,%eax
call   1080 <diagnostics@plt>
lea    0xe58(%rip),%rdx
lea    0xe59(%rip),%rcx
lea    0xe57(%rip),%r9
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0x64,%esi
mov    %rbx,%r8
call   1060 <snprintf@plt>
lea    0xe3f(%rip),%rdi
call   1040 <TexFontNumber@plt>
mov    %eax,%ebp
xor    %edi,%edi
call   10c0 <CmdEndParagraph@plt>
mov    $0x1,%edi
call   1050 <CmdIndent@plt>
lea    0xe2b(%rip),%rdi
mov    $0x2,%esi
call   1090 <startParagraph@plt>
lea    0xe21(%rip),%rdi
xor    %eax,%eax
call   10a0 <fprintRTF@plt>
lea    0xe28(%rip),%rdi
mov    %ebp,%esi
mov    %rbx,%rdx
mov    %rbx,%rcx
xor    %eax,%eax
call   10a0 <fprintRTF@plt>
xor    %edi,%edi
call   10c0 <CmdEndParagraph@plt>
mov    $0x2,%edi
call   1050 <CmdIndent@plt>
mov    %r14,%rdi
xor    %esi,%esi
call   10b0 <getTexUntil@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1070 <ConvertString@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
lea    0xe0f(%rip),%rsi
mov    $0x4,%edi
xor    %eax,%eax
call   1080 <diagnostics@plt>
add    $0x70,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [32 x i8] c"Entering IgnoreEnvironment <%s>\00"
@.str.1 = [8 x i8] c"\\%s%s%s\00"
@.str.2 = [5 x i8] c"end{\00"
@.str.3 = [2 x i8] c"}\00"
@.str.4 = [11 x i8] c"Typewriter\00"
@.str.5 = [7 x i8] c"Normal\00"
@.str.6 = [21 x i8] c"\\qc [Sorry. Ignored \00"
@.str.7 = [43 x i8] c"{\\plain\\f%d\\\\begin\\{%s\\} ... \\\\end\\{%s\\}}]\00"
@.str.8 = [26 x i8] c"Exiting IgnoreEnvironment\00"
define void @Ignore_Environment(i8* %0) {
%2 = alloca i8*
%3 = alloca [100 x i8]
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %2
%6 = load i8*, i8** %2
%7 = call i32 (i32, i8*, ...) @diagnostics(i32 4, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%9 = load i8*, i8** %2
%10 = call i32 @snprintf(i8* %8, i32 100, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* %9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%11 = call i32 @TexFontNumber(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0))
store i32 %11, i32* %5
%12 = call i32 @CmdEndParagraph(i32 0)
%13 = call i32 @CmdIndent(i32 1)
%14 = call i32 @startParagraph(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), i32 2)
%15 = call i32 (i8*, ...) @fprintRTF(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.6, i64 0, i64 0))
%16 = load i32, i32* %5
%17 = load i8*, i8** %2
%18 = load i8*, i8** %2
%19 = call i32 (i8*, ...) @fprintRTF(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.7, i64 0, i64 0), i32 %16, i8* %17, i8* %18)
%20 = call i32 @CmdEndParagraph(i32 0)
%21 = call i32 @CmdIndent(i32 2)
%22 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%23 = call i8* @getTexUntil(i8* %22, i32 0)
store i8* %23, i8** %4
%24 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%25 = call i32 @ConvertString(i8* %24)
%26 = load i8*, i8** %4
%27 = call i32 @free(i8* %26)
%28 = call i32 (i32, i8*, ...) @diagnostics(i32 4, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.8, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [32 x i8] c"Entering IgnoreEnvironment <%s>\00"
@.str.1 = [8 x i8] c"\\%s%s%s\00"
@.str.2 = [5 x i8] c"end{\00"
@.str.3 = [2 x i8] c"}\00"
@.str.4 = [11 x i8] c"Typewriter\00"
@.str.5 = [7 x i8] c"Normal\00"
@.str.6 = [21 x i8] c"\\qc [Sorry. Ignored \00"
@.str.7 = [43 x i8] c"{\\plain\\f%d\\\\begin\\{%s\\} ... \\\\end\\{%s\\}}]\00"
@.str.8 = [26 x i8] c"Exiting IgnoreEnvironment\00"
define void @Ignore_Environment(i8* %0) {
%2 = alloca [100 x i8]
%3 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%4 = tail call i32 (i32, i8*, ...) @diagnostics(i32 4, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = call i32 @snprintf(i8* %3, i32 100, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%6 = call i32 @TexFontNumber(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0))
%7 = call i32 @CmdEndParagraph(i32 0)
%8 = call i32 @CmdIndent(i32 1)
%9 = call i32 @startParagraph(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), i32 2)
%10 = call i32 (i8*, ...) @fprintRTF(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.6, i64 0, i64 0))
%11 = call i32 (i8*, ...) @fprintRTF(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.7, i64 0, i64 0), i32 %6, i8* %0, i8* %0)
%12 = call i32 @CmdEndParagraph(i32 0)
%13 = call i32 @CmdIndent(i32 2)
%14 = call i8* @getTexUntil(i8* %3, i32 0)
%15 = call i32 @ConvertString(i8* %3)
%16 = call i32 @free(i8* %14)
%17 = call i32 (i32, i8*, ...) @diagnostics(i32 4, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.8, i64 0, i64 0))
ret void
}