#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*/ ConvertString(char *);
int /*<<< orphan*/ free(char *);
char *getTexUntil(char *, int /*<<< orphan*/);
char *my_strdup(char *);
void CmdIgnoreEnviron(int code) {
  char *endtag = NULL;
  char *s = NULL;
  if (code & 0x4000) {
    switch (code & ~(0x4000)) {
    case 3:
      endtag = my_strdup("\\end{minipage}");
      break;
    case 1:
      endtag = my_strdup("\\end{htmlonly}");
      break;
    case 4:
      endtag = my_strdup("\\end{rawhtml}");
      break;
    }
    if (endtag) {
      s = getTexUntil(endtag, 0);
      ConvertString(endtag);
      if (s)
        free(s);
      free(endtag);
    }
  }
}


x86 assembly (clang, -O0):
<CmdIgnoreEnviron>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x4(%rbp),%eax
and    $0x4000,%eax
cmp    $0x0,%eax
je     1226 <CmdIgnoreEnviron+0xe6>
mov    -0x4(%rbp),%eax
and    $0xffffbfff,%eax
mov    %eax,-0x1c(%rbp)
sub    $0x1,%eax
je     11bc <CmdIgnoreEnviron+0x7c>
jmp    1185 <CmdIgnoreEnviron+0x45>
mov    -0x1c(%rbp),%eax
sub    $0x3,%eax
je     11a7 <CmdIgnoreEnviron+0x67>
jmp    1196 <CmdIgnoreEnviron+0x56>
mov    -0x1c(%rbp),%eax
sub    $0x4,%eax
je     11d1 <CmdIgnoreEnviron+0x91>
jmp    11e1 <CmdIgnoreEnviron+0xa1>
lea    0xe52(%rip),%rdi
call   1050 <my_strdup@plt>
mov    %rax,-0x10(%rbp)
jmp    11e1 <CmdIgnoreEnviron+0xa1>
lea    0xe4c(%rip),%rdi
call   1050 <my_strdup@plt>
mov    %rax,-0x10(%rbp)
jmp    11e1 <CmdIgnoreEnviron+0xa1>
lea    0xe46(%rip),%rdi
call   1050 <my_strdup@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1221 <CmdIgnoreEnviron+0xe1>
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
call   1060 <getTexUntil@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <ConvertString@plt>
cmpq   $0x0,-0x18(%rbp)
je     1218 <CmdIgnoreEnviron+0xd8>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
jmp    1226 <CmdIgnoreEnviron+0xe6>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CmdIgnoreEnviron>:
push   %r14
push   %rbx
push   %rax
test   $0x4000,%edi
je     11b8 <CmdIgnoreEnviron+0x78>
and    $0xffffbfff,%edi
cmp    $0x4,%edi
je     116a <CmdIgnoreEnviron+0x2a>
cmp    $0x3,%edi
je     1173 <CmdIgnoreEnviron+0x33>
cmp    $0x1,%edi
jne    11b8 <CmdIgnoreEnviron+0x78>
lea    0xea7(%rip),%rdi
jmp    117a <CmdIgnoreEnviron+0x3a>
lea    0xead(%rip),%rdi
jmp    117a <CmdIgnoreEnviron+0x3a>
lea    0xe86(%rip),%rdi
call   1050 <my_strdup@plt>
test   %rax,%rax
je     11b8 <CmdIgnoreEnviron+0x78>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
call   1060 <getTexUntil@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1040 <ConvertString@plt>
test   %r14,%r14
je     11a9 <CmdIgnoreEnviron+0x69>
mov    %r14,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [15 x i8] c"\\end{minipage}\00"
@.str.1 = [15 x i8] c"\\end{htmlonly}\00"
@.str.2 = [14 x i8] c"\\end{rawhtml}\00"
define void @CmdIgnoreEnviron(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i8*
store i32 %0, i32* %2
store i8* null, i8** %3
store i8* null, i8** %4
%5 = load i32, i32* %2
%6 = and i32 %5, 16384
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %34
8: ; preds = %1
%9 = load i32, i32* %2
%10 = and i32 %9, -16385
switch i32 %10, label %17 [
i32 3, label %11
i32 1, label %13
i32 4, label %15
]
11: ; preds = %8
%12 = call i8* @my_strdup(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
store i8* %12, i8** %3
br label %17
13: ; preds = %8
%14 = call i8* @my_strdup(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
store i8* %14, i8** %3
br label %17
15: ; preds = %8
%16 = call i8* @my_strdup(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
store i8* %16, i8** %3
br label %17
17: ; preds = %8, %15, %13, %11
%18 = load i8*, i8** %3
%19 = icmp ne i8* %18, null
br i1 %19, label %20, label %33
20: ; preds = %17
%21 = load i8*, i8** %3
%22 = call i8* @getTexUntil(i8* %21, i32 0)
store i8* %22, i8** %4
%23 = load i8*, i8** %3
%24 = call i32 @ConvertString(i8* %23)
%25 = load i8*, i8** %4
%26 = icmp ne i8* %25, null
br i1 %26, label %27, label %30
27: ; preds = %20
%28 = load i8*, i8** %4
%29 = call i32 @free(i8* %28)
br label %30
30: ; preds = %27, %20
%31 = load i8*, i8** %3
%32 = call i32 @free(i8* %31)
br label %33
33: ; preds = %30, %17
br label %34
34: ; preds = %33, %1
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"\\end{minipage}\00"
@.str.1 = [15 x i8] c"\\end{htmlonly}\00"
@.str.2 = [14 x i8] c"\\end{rawhtml}\00"
define void @CmdIgnoreEnviron(i32 %0) {
%2 = and i32 %0, 16384
%3 = icmp eq i32 %2, 0
br i1 %3, label %20, label %4
4: ; preds = %1
%5 = and i32 %0, -16385
switch i32 %5, label %20 [
i32 3, label %8
i32 1, label %6
i32 4, label %7
]
6: ; preds = %4
br label %8
7: ; preds = %4
br label %8
8: ; preds = %4, %7, %6
%9 = phi i8* [ getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), %7 ], [ getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), %6 ], [ getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), %4 ]
%10 = tail call i8* @my_strdup(i8* %9)
%11 = icmp eq i8* %10, null
br i1 %11, label %20, label %12
12: ; preds = %8
%13 = tail call i8* @getTexUntil(i8* %10, i32 0)
%14 = tail call i32 @ConvertString(i8* %10)
%15 = icmp eq i8* %13, null
br i1 %15, label %18, label %16
16: ; preds = %12
%17 = tail call i32 @free(i8* %13)
br label %18
18: ; preds = %16, %12
%19 = tail call i32 @free(i8* %10)
br label %20
20: ; preds = %4, %8, %18, %1
ret void
}