#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*/ diagnostics(int, char *, int);
int getDimension();
char getNonSpace();
int /*<<< orphan*/ setLength(char *, int);
int /*<<< orphan*/ skipSpaces();
int /*<<< orphan*/ ungetTexChar(char);
void CmdSetTexLength(int code) {
  int d;
  char c;
  c = getNonSpace();
  if (c == '=')
    skipSpaces();
  else
    ungetTexChar(c);
  d = getDimension();
  diagnostics(4, "CmdSetTexLength size = %d", d);
  switch (code) {
  case 1:
    setLength("hoffset", d);
    break;
  case 2:
    setLength("voffset", d);
    break;
  case 3:
    setLength("parindent", d);
    break;
  case 4:
    setLength("parskip", d);
    break;
  case 5:
    setLength("baselineskip", d);
    break;
  case 6:
    setLength("topmargin", d);
    break;
  case 7:
    setLength("textheight", d);
    break;
  case 8:
    setLength("headheight", d);
    break;
  case 9:
    setLength("headsep", d);
    break;
  case 10:
    setLength("textwidth", d);
    break;
  case 11:
    setLength("oddsidemargin", d);
    break;
  case 12:
    setLength("evensidemargin", d);
    break;
  case 13:
    setLength("linewidth", d);
    break;
  }
}


x86 assembly (clang, -O0):
<CmdSetTexLength>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1060 <getNonSpace@plt>
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%eax
cmp    $0x3d,%eax
jne    118e <CmdSetTexLength+0x2e>
mov    $0x0,%al
call   1080 <skipSpaces@plt>
jmp    1197 <CmdSetTexLength+0x37>
movsbl -0x9(%rbp),%edi
call   1040 <ungetTexChar@plt>
xor    %eax,%eax
call   1070 <getDimension@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edx
lea    0xe89(%rip),%rsi
mov    $0x4,%edi
call   1050 <diagnostics@plt>
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0xc,%eax
ja     12dd <CmdSetTexLength+0x17d>
mov    -0x18(%rbp),%rax
lea    0xe2b(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x8(%rbp),%esi
lea    0xe66(%rip),%rdi
call   1030 <setLength@plt>
jmp    12dd <CmdSetTexLength+0x17d>
mov    -0x8(%rbp),%esi
lea    0xe5a(%rip),%rdi
call   1030 <setLength@plt>
jmp    12dd <CmdSetTexLength+0x17d>
mov    -0x8(%rbp),%esi
lea    0xe4e(%rip),%rdi
call   1030 <setLength@plt>
jmp    12dd <CmdSetTexLength+0x17d>
mov    -0x8(%rbp),%esi
lea    0xe44(%rip),%rdi
call   1030 <setLength@plt>
jmp    12dd <CmdSetTexLength+0x17d>
mov    -0x8(%rbp),%esi
lea    0xe38(%rip),%rdi
call   1030 <setLength@plt>
jmp    12dd <CmdSetTexLength+0x17d>
mov    -0x8(%rbp),%esi
lea    0xe31(%rip),%rdi
call   1030 <setLength@plt>
jmp    12dd <CmdSetTexLength+0x17d>
mov    -0x8(%rbp),%esi
lea    0xe27(%rip),%rdi
call   1030 <setLength@plt>
jmp    12dd <CmdSetTexLength+0x17d>
mov    -0x8(%rbp),%esi
lea    0xe1e(%rip),%rdi
call   1030 <setLength@plt>
jmp    12dd <CmdSetTexLength+0x17d>
mov    -0x8(%rbp),%esi
lea    0xe15(%rip),%rdi
call   1030 <setLength@plt>
jmp    12dd <CmdSetTexLength+0x17d>
mov    -0x8(%rbp),%esi
lea    0xe09(%rip),%rdi
call   1030 <setLength@plt>
jmp    12dd <CmdSetTexLength+0x17d>
mov    -0x8(%rbp),%esi
lea    0xdff(%rip),%rdi
call   1030 <setLength@plt>
jmp    12dd <CmdSetTexLength+0x17d>
mov    -0x8(%rbp),%esi
lea    0xdf9(%rip),%rdi
call   1030 <setLength@plt>
jmp    12dd <CmdSetTexLength+0x17d>
mov    -0x8(%rbp),%esi
lea    0xdf4(%rip),%rdi
call   1030 <setLength@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CmdSetTexLength>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %eax,%eax
call   1060 <getNonSpace@plt>
cmp    $0x3d,%al
jne    1179 <CmdSetTexLength+0x19>
xor    %eax,%eax
call   1080 <skipSpaces@plt>
jmp    1181 <CmdSetTexLength+0x21>
movsbl %al,%edi
call   1040 <ungetTexChar@plt>
xor    %eax,%eax
call   1070 <getDimension@plt>
mov    %eax,%ebp
lea    0xe6f(%rip),%rsi
mov    $0x4,%edi
mov    %eax,%edx
call   1050 <diagnostics@plt>
add    $0xffffffff,%ebx
cmp    $0xc,%ebx
ja     11c3 <CmdSetTexLength+0x63>
movslq %ebx,%rax
lea    0xef5(%rip),%rcx
movslq (%rcx,%rax,4),%rdi
add    %rcx,%rdi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <setLength@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [26 x i8] c"CmdSetTexLength size = %d\00"
@.str.1 = [8 x i8] c"hoffset\00"
@.str.2 = [8 x i8] c"voffset\00"
@.str.3 = [10 x i8] c"parindent\00"
@.str.4 = [8 x i8] c"parskip\00"
@.str.5 = [13 x i8] c"baselineskip\00"
@.str.6 = [10 x i8] c"topmargin\00"
@.str.7 = [11 x i8] c"textheight\00"
@.str.8 = [11 x i8] c"headheight\00"
@.str.9 = [8 x i8] c"headsep\00"
@.str.10 = [10 x i8] c"textwidth\00"
@.str.11 = [14 x i8] c"oddsidemargin\00"
@.str.12 = [15 x i8] c"evensidemargin\00"
@.str.13 = [10 x i8] c"linewidth\00"
define void @CmdSetTexLength(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i8
store i32 %0, i32* %2
%5 = call signext i8 (...) @getNonSpace()
store i8 %5, i8* %4
%6 = load i8, i8* %4
%7 = sext i8 %6 to i32
%8 = icmp eq i32 %7, 61
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = call i32 (...) @skipSpaces()
br label %14
11: ; preds = %1
%12 = load i8, i8* %4
%13 = call i32 @ungetTexChar(i8 signext %12)
br label %14
14: ; preds = %11, %9
%15 = call i32 (...) @getDimension()
store i32 %15, i32* %3
%16 = load i32, i32* %3
%17 = call i32 @diagnostics(i32 4, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %16)
%18 = load i32, i32* %2
switch i32 %18, label %58 [
i32 1, label %19
i32 2, label %22
i32 3, label %25
i32 4, label %28
i32 5, label %31
i32 6, label %34
i32 7, label %37
i32 8, label %40
i32 9, label %43
i32 10, label %46
i32 11, label %49
i32 12, label %52
i32 13, label %55
]
19: ; preds = %14
%20 = load i32, i32* %3
%21 = call i32 @setLength(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %20)
br label %58
22: ; preds = %14
%23 = load i32, i32* %3
%24 = call i32 @setLength(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 %23)
br label %58
25: ; preds = %14
%26 = load i32, i32* %3
%27 = call i32 @setLength(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i32 %26)
br label %58
28: ; preds = %14
%29 = load i32, i32* %3
%30 = call i32 @setLength(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i32 %29)
br label %58
31: ; preds = %14
%32 = load i32, i32* %3
%33 = call i32 @setLength(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0), i32 %32)
br label %58
34: ; preds = %14
%35 = load i32, i32* %3
%36 = call i32 @setLength(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0), i32 %35)
br label %58
37: ; preds = %14
%38 = load i32, i32* %3
%39 = call i32 @setLength(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.7, i64 0, i64 0), i32 %38)
br label %58
40: ; preds = %14
%41 = load i32, i32* %3
%42 = call i32 @setLength(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.8, i64 0, i64 0), i32 %41)
br label %58
43: ; preds = %14
%44 = load i32, i32* %3
%45 = call i32 @setLength(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.9, i64 0, i64 0), i32 %44)
br label %58
46: ; preds = %14
%47 = load i32, i32* %3
%48 = call i32 @setLength(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.10, i64 0, i64 0), i32 %47)
br label %58
49: ; preds = %14
%50 = load i32, i32* %3
%51 = call i32 @setLength(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.11, i64 0, i64 0), i32 %50)
br label %58
52: ; preds = %14
%53 = load i32, i32* %3
%54 = call i32 @setLength(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.12, i64 0, i64 0), i32 %53)
br label %58
55: ; preds = %14
%56 = load i32, i32* %3
%57 = call i32 @setLength(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.13, i64 0, i64 0), i32 %56)
br label %58
58: ; preds = %14, %55, %52, %49, %46, %43, %40, %37, %34, %31, %28, %25, %22, %19
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"CmdSetTexLength size = %d\00"
@.str.1 = [8 x i8] c"hoffset\00"
@.str.2 = [8 x i8] c"voffset\00"
@.str.3 = [10 x i8] c"parindent\00"
@.str.4 = [8 x i8] c"parskip\00"
@.str.5 = [13 x i8] c"baselineskip\00"
@.str.6 = [10 x i8] c"topmargin\00"
@.str.7 = [11 x i8] c"textheight\00"
@.str.8 = [11 x i8] c"headheight\00"
@.str.9 = [8 x i8] c"headsep\00"
@.str.10 = [10 x i8] c"textwidth\00"
@.str.11 = [14 x i8] c"oddsidemargin\00"
@.str.12 = [15 x i8] c"evensidemargin\00"
@.str.13 = [10 x i8] c"linewidth\00"
@reltable.CmdSetTexLength = [13 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str.1 to i64), i64 ptrtoint ([13 x i32]* @reltable.CmdSetTexLength to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str.2 to i64), i64 ptrtoint ([13 x i32]* @reltable.CmdSetTexLength to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([10 x i8]* @.str.3 to i64), i64 ptrtoint ([13 x i32]* @reltable.CmdSetTexLength to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str.4 to i64), i64 ptrtoint ([13 x i32]* @reltable.CmdSetTexLength to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([13 x i8]* @.str.5 to i64), i64 ptrtoint ([13 x i32]* @reltable.CmdSetTexLength to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([10 x i8]* @.str.6 to i64), i64 ptrtoint ([13 x i32]* @reltable.CmdSetTexLength to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([11 x i8]* @.str.7 to i64), i64 ptrtoint ([13 x i32]* @reltable.CmdSetTexLength to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([11 x i8]* @.str.8 to i64), i64 ptrtoint ([13 x i32]* @reltable.CmdSetTexLength to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str.9 to i64), i64 ptrtoint ([13 x i32]* @reltable.CmdSetTexLength to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([10 x i8]* @.str.10 to i64), i64 ptrtoint ([13 x i32]* @reltable.CmdSetTexLength to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([14 x i8]* @.str.11 to i64), i64 ptrtoint ([13 x i32]* @reltable.CmdSetTexLength to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([15 x i8]* @.str.12 to i64), i64 ptrtoint ([13 x i32]* @reltable.CmdSetTexLength to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([10 x i8]* @.str.13 to i64), i64 ptrtoint ([13 x i32]* @reltable.CmdSetTexLength to i64)) to i32)]
define void @CmdSetTexLength(i32 %0) {
%2 = tail call signext i8 (...) @getNonSpace()
%3 = icmp eq i8 %2, 61
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @skipSpaces()
br label %8
6: ; preds = %1
%7 = tail call i32 @ungetTexChar(i8 signext %2)
br label %8
8: ; preds = %6, %4
%9 = tail call i32 (...) @getDimension()
%10 = tail call i32 @diagnostics(i32 4, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add i32 %0, -1
%12 = icmp ult i32 %11, 13
br i1 %12, label %13, label %18
13: ; preds = %8
%14 = sext i32 %11 to i64
%15 = shl i64 %14, 2
%16 = call i8* @llvm.load.relative.i64(i8* bitcast ([13 x i32]* @reltable.CmdSetTexLength to i8*), i64 %15)
%17 = tail call i32 @setLength(i8* %16, i32 %9)
br label %18
18: ; preds = %8, %13
ret void
}