#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*/ changeTexMode(int);
int /*<<< orphan*/ fprintRTF(char *, ...);
char getNonSpace();
int getTexMode();
int /*<<< orphan*/ ungetTexChar(char);
void CmdNonBreakSpace(int code) {
  char cThis;
  cThis = getNonSpace();
  ungetTexChar(cThis);
  if (getTexMode() == 6)
    changeTexMode(2);
  if (code == 100)
    fprintRTF("\\~ ");
  else
    fprintRTF("{\\charscalex%d\\~}", code);
}


x86 assembly (clang, -O0):
<CmdNonBreakSpace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1060 <getNonSpace@plt>
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%edi
call   1040 <ungetTexChar@plt>
mov    $0x0,%al
call   1050 <getTexMode@plt>
cmp    $0x6,%eax
jne    1188 <CmdNonBreakSpace+0x38>
mov    $0x2,%edi
call   1030 <changeTexMode@plt>
cmpl   $0x64,-0x4(%rbp)
jne    11a5 <CmdNonBreakSpace+0x55>
lea    0xe67(%rip),%rdi
mov    $0x0,%al
call   1070 <fprintRTF@plt>
jmp    11b6 <CmdNonBreakSpace+0x66>
mov    -0x4(%rbp),%esi
lea    0xe55(%rip),%rdi
mov    $0x0,%al
call   1070 <fprintRTF@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CmdNonBreakSpace>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1060 <getNonSpace@plt>
movsbl %al,%edi
call   1040 <ungetTexChar@plt>
xor    %eax,%eax
call   1050 <getTexMode@plt>
cmp    $0x6,%eax
jne    1178 <CmdNonBreakSpace+0x28>
mov    $0x2,%edi
call   1030 <changeTexMode@plt>
cmp    $0x64,%ebx
jne    118c <CmdNonBreakSpace+0x3c>
lea    0xe7c(%rip),%rdi
xor    %eax,%eax
pop    %rbx
jmp    1070 <fprintRTF@plt>
lea    0xe71(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
pop    %rbx
jmp    1070 <fprintRTF@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"\\~ \00"
@.str.1 = [18 x i8] c"{\\charscalex%d\\~}\00"
define void @CmdNonBreakSpace(i32 %0) {
%2 = alloca i32
%3 = alloca i8
store i32 %0, i32* %2
%4 = call signext i8 (...) @getNonSpace()
store i8 %4, i8* %3
%5 = load i8, i8* %3
%6 = call i32 @ungetTexChar(i8 signext %5)
%7 = call i32 (...) @getTexMode()
%8 = icmp eq i32 %7, 6
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = call i32 @changeTexMode(i32 2)
br label %11
11: ; preds = %9, %1
%12 = load i32, i32* %2
%13 = icmp eq i32 %12, 100
br i1 %13, label %14, label %16
14: ; preds = %11
%15 = call i32 (i8*, ...) @fprintRTF(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %19
16: ; preds = %11
%17 = load i32, i32* %2
%18 = call i32 (i8*, ...) @fprintRTF(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 %17)
br label %19
19: ; preds = %16, %14
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"\\~ \00"
@.str.1 = [18 x i8] c"{\\charscalex%d\\~}\00"
define void @CmdNonBreakSpace(i32 %0) {
%2 = tail call signext i8 (...) @getNonSpace()
%3 = tail call i32 @ungetTexChar(i8 signext %2)
%4 = tail call i32 (...) @getTexMode()
%5 = icmp eq i32 %4, 6
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = tail call i32 @changeTexMode(i32 2)
br label %8
8: ; preds = %6, %1
%9 = icmp eq i32 %0, 100
br i1 %9, label %10, label %12
10: ; preds = %8
%11 = tail call i32 (i8*, ...) @fprintRTF(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %14
12: ; preds = %8
%13 = tail call i32 (i8*, ...) @fprintRTF(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 %0)
br label %14
14: ; preds = %12, %10
ret void
}