#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 */
float CurrentFontSize();
int /*<<< orphan*/ diagnostics(int, char *, ...);
int /*<<< orphan*/ free(char *);
float getLength(char *);
char *getSimpleCommand();
char getTexChar();
scalar_t__ isdigit(int);
int /*<<< orphan*/ skipSpaces();
int sscanf(char *, char *, float *);
scalar_t__ strstr(char *, char *);
char tolower(int);
int /*<<< orphan*/ ungetTexChar(char);
int getDimension(void) {
  char cThis, buffer[20];
  int i = 0;
  float num;
  skipSpaces();
  cThis = getTexChar();
  if (cThis == 't') {
    getTexChar();
    cThis = getTexChar();
  }
  if (cThis == 's') {
    getTexChar();
    getTexChar();
    getTexChar();
    getTexChar();
    getTexChar();
    cThis = getTexChar();
  }
  if (cThis == '-' || cThis == '+') {
    buffer[i++] = cThis;
    skipSpaces();
    cThis = getTexChar();
  }
  if (cThis == '\\')
    buffer[i++] = '1';
  else {
    while (i < 19 && (isdigit((int)cThis) || cThis == '.' || cThis == ',')) {
      if (cThis == ',')
        cThis = '.';
      buffer[i++] = cThis;
      cThis = getTexChar();
    }
  }
  ungetTexChar(cThis);
  buffer[i] = '\0';
  diagnostics(4, "getDimension() raw number is <%s>", buffer);
  if (i == 19 || sscanf(buffer, "%f", &num) != 1) {
    diagnostics(1, "Screwy number in TeX dimension");
    diagnostics(1, "getDimension() number is <%s>", buffer);
    return 0;
  }
  skipSpaces();
  buffer[0] = tolower((int)getTexChar());
  if (buffer[0] == '\0')
    return (int)(num * 20);
  if (buffer[0] == 't') {
    getTexChar();
    getTexChar();
    getTexChar();
    skipSpaces();
    buffer[0] = tolower((int)getTexChar());
  }
  if (buffer[0] != '\\') {
    buffer[1] = tolower((int)getTexChar());
    buffer[2] = '\0';
    diagnostics(4, "getDimension() dimension is <%s>", buffer);
    if (strstr(buffer, "pt"))
      return (int)(num * 20);
    else if (strstr(buffer, "pc"))
      return (int)(num * 12 * 20);
    else if (strstr(buffer, "in"))
      return (int)(num * 72.27 * 20);
    else if (strstr(buffer, "bp"))
      return (int)(num * 72.27 / 72 * 20);
    else if (strstr(buffer, "cm"))
      return (int)(num * 72.27 / 2.54 * 20);
    else if (strstr(buffer, "mm"))
      return (int)(num * 72.27 / 25.4 * 20);
    else if (strstr(buffer, "dd"))
      return (int)(num * 1238.0 / 1157.0 * 20);
    else if (strstr(buffer, "dd"))
      return (int)(num * 1238.0 / 1157 * 20);
    else if (strstr(buffer, "cc"))
      return (int)(num * 1238.0 / 1157.0 * 12.0 * 20);
    else if (strstr(buffer, "sp"))
      return (int)(num / 65536.0 * 20);
    else if (strstr(buffer, "ex"))
      return (int)(num * CurrentFontSize() * 0.5);
    else if (strstr(buffer, "em"))
      return (int)(num * CurrentFontSize());
    else if (strstr(buffer, "in"))
      return (int)(num * 72.27 * 20);
    else {
      ungetTexChar(buffer[1]);
      ungetTexChar(buffer[0]);
      return (int)num;
    }
  } else {
    char *s, *t;
    ungetTexChar(buffer[0]);
    s = getSimpleCommand();
    t = s + 1;
    diagnostics(4, "getDimension() dimension is <%s>", t);
    num *= getLength(t);
    free(s);
    return (int)num;
  }
}


x86 assembly (clang, -O0):
<getDimension>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x24(%rbp)
mov    $0x0,%al
call   10b0 <skipSpaces@plt>
mov    $0x0,%al
call   1060 <getTexChar@plt>
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x74,%eax
jne    11fe <getDimension+0x3e>
mov    $0x0,%al
call   1060 <getTexChar@plt>
mov    $0x0,%al
call   1060 <getTexChar@plt>
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x73,%eax
jne    1238 <getDimension+0x78>
mov    $0x0,%al
call   1060 <getTexChar@plt>
mov    $0x0,%al
call   1060 <getTexChar@plt>
mov    $0x0,%al
call   1060 <getTexChar@plt>
mov    $0x0,%al
call   1060 <getTexChar@plt>
mov    $0x0,%al
call   1060 <getTexChar@plt>
mov    $0x0,%al
call   1060 <getTexChar@plt>
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x2d,%eax
je     1252 <getDimension+0x92>
movsbl -0x5(%rbp),%eax
cmp    $0x2b,%eax
jne    1277 <getDimension+0xb7>
mov    -0x5(%rbp),%cl
mov    -0x24(%rbp),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,-0x24(%rbp)
cltq
mov    %cl,-0x20(%rbp,%rax,1)
mov    $0x0,%al
call   10b0 <skipSpaces@plt>
mov    $0x0,%al
call   1060 <getTexChar@plt>
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x5c,%eax
jne    129b <getDimension+0xdb>
mov    -0x24(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x24(%rbp)
cltq
movb   $0x31,-0x20(%rbp,%rax,1)
jmp    1338 <getDimension+0x178>
jmp    12a0 <getDimension+0xe0>
xor    %eax,%eax
cmpl   $0x13,-0x24(%rbp)
mov    %al,-0x39(%rbp)
jge    12ef <getDimension+0x12f>
movsbl -0x5(%rbp),%edi
call   1040 <isdigit@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x3a(%rbp)
jne    12e9 <getDimension+0x129>
movsbl -0x5(%rbp),%ecx
mov    $0x1,%al
cmp    $0x2e,%ecx
mov    %al,-0x3a(%rbp)
je     12e9 <getDimension+0x129>
movsbl -0x5(%rbp),%eax
cmp    $0x2c,%eax
sete   %al
mov    %al,-0x3a(%rbp)
mov    -0x3a(%rbp),%al
mov    %al,-0x39(%rbp)
mov    -0x39(%rbp),%al
test   $0x1,%al
jne    12ff <getDimension+0x13f>
jmp    1333 <getDimension+0x173>
movsbl -0x5(%rbp),%eax
cmp    $0x2c,%eax
jne    1310 <getDimension+0x150>
movb   $0x2e,-0x5(%rbp)
mov    -0x5(%rbp),%cl
mov    -0x24(%rbp),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,-0x24(%rbp)
cltq
mov    %cl,-0x20(%rbp,%rax,1)
mov    $0x0,%al
call   1060 <getTexChar@plt>
mov    %al,-0x5(%rbp)
jmp    12a0 <getDimension+0xe0>
jmp    1338 <getDimension+0x178>
movsbl -0x5(%rbp),%edi
call   1050 <ungetTexChar@plt>
movslq -0x24(%rbp),%rax
movb   $0x0,-0x20(%rbp,%rax,1)
lea    -0x20(%rbp),%rdx
mov    $0x4,%edi
lea    0xcfe(%rip),%rsi
mov    $0x0,%al
call   1070 <diagnostics@plt>
cmpl   $0x13,-0x24(%rbp)
je     1388 <getDimension+0x1c8>
lea    -0x20(%rbp),%rdi
lea    0xd04(%rip),%rsi
lea    -0x28(%rbp),%rdx
call   1090 <sscanf@plt>
cmp    $0x1,%eax
je     13be <getDimension+0x1fe>
mov    $0x1,%edi
lea    0xce9(%rip),%rsi
mov    $0x0,%al
call   1070 <diagnostics@plt>
lea    -0x20(%rbp),%rdx
mov    $0x1,%edi
lea    0xcf1(%rip),%rsi
mov    $0x0,%al
call   1070 <diagnostics@plt>
movl   $0x0,-0x4(%rbp)
jmp    18c7 <getDimension+0x707>
mov    $0x0,%al
call   10b0 <skipSpaces@plt>
mov    $0x0,%al
call   1060 <getTexChar@plt>
movsbl %al,%edi
call   1080 <tolower@plt>
mov    %al,-0x20(%rbp)
movsbl -0x20(%rbp),%eax
cmp    $0x0,%eax
jne    13fd <getDimension+0x23d>
movss  0xc64(%rip),%xmm0
mulss  -0x28(%rbp),%xmm0
cvttss2si %xmm0,%eax
mov    %eax,-0x4(%rbp)
jmp    18c7 <getDimension+0x707>
movsbl -0x20(%rbp),%eax
cmp    $0x74,%eax
jne    1438 <getDimension+0x278>
mov    $0x0,%al
call   1060 <getTexChar@plt>
mov    $0x0,%al
call   1060 <getTexChar@plt>
mov    $0x0,%al
call   1060 <getTexChar@plt>
mov    $0x0,%al
call   10b0 <skipSpaces@plt>
mov    $0x0,%al
call   1060 <getTexChar@plt>
movsbl %al,%edi
call   1080 <tolower@plt>
mov    %al,-0x20(%rbp)
movsbl -0x20(%rbp),%eax
cmp    $0x5c,%eax
je     186c <getDimension+0x6ac>
mov    $0x0,%al
call   1060 <getTexChar@plt>
movsbl %al,%edi
call   1080 <tolower@plt>
mov    %al,-0x1f(%rbp)
movb   $0x0,-0x1e(%rbp)
lea    -0x20(%rbp),%rdx
mov    $0x4,%edi
lea    0xc4f(%rip),%rsi
mov    $0x0,%al
call   1070 <diagnostics@plt>
lea    -0x20(%rbp),%rdi
lea    0xc5e(%rip),%rsi
call   10e0 <strstr@plt>
cmp    $0x0,%rax
je     14a5 <getDimension+0x2e5>
movss  0xbbc(%rip),%xmm0
mulss  -0x28(%rbp),%xmm0
cvttss2si %xmm0,%eax
mov    %eax,-0x4(%rbp)
jmp    18c7 <getDimension+0x707>
lea    -0x20(%rbp),%rdi
lea    0xc2e(%rip),%rsi
call   10e0 <strstr@plt>
cmp    $0x0,%rax
je     14e4 <getDimension+0x324>
movss  0xb8d(%rip),%xmm0
mulss  -0x28(%rbp),%xmm0
movss  0xb7c(%rip),%xmm1
mulss  %xmm1,%xmm0
cvttss2si %xmm0,%eax
mov    %eax,-0x4(%rbp)
jmp    18c7 <getDimension+0x707>
lea    -0x20(%rbp),%rdi
lea    0xbf2(%rip),%rsi
call   10e0 <strstr@plt>
cmp    $0x0,%rax
je     152b <getDimension+0x36b>
movss  -0x28(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xaf9(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xae5(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x4(%rbp)
jmp    18c7 <getDimension+0x707>
lea    -0x20(%rbp),%rdi
lea    0xbae(%rip),%rsi
call   10e0 <strstr@plt>
cmp    $0x0,%rax
je     157e <getDimension+0x3be>
movss  -0x28(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xab2(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xae6(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xa92(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x4(%rbp)
jmp    18c7 <getDimension+0x707>
lea    -0x20(%rbp),%rdi
lea    0xb5e(%rip),%rsi
call   10e0 <strstr@plt>
cmp    $0x0,%rax
je     15d1 <getDimension+0x411>
movss  -0x28(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xa5f(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xa8b(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xa3f(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x4(%rbp)
jmp    18c7 <getDimension+0x707>
lea    -0x20(%rbp),%rdi
lea    0xb0e(%rip),%rsi
call   10e0 <strstr@plt>
cmp    $0x0,%rax
je     1624 <getDimension+0x464>
movss  -0x28(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xa0c(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xa30(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0x9ec(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x4(%rbp)
jmp    18c7 <getDimension+0x707>
lea    -0x20(%rbp),%rdi
lea    0xabe(%rip),%rsi
call   10e0 <strstr@plt>
cmp    $0x0,%rax
je     1677 <getDimension+0x4b7>
movss  -0x28(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0x9e1(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0x9cd(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0x999(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x4(%rbp)
jmp    18c7 <getDimension+0x707>
lea    -0x20(%rbp),%rdi
lea    0xa6b(%rip),%rsi
call   10e0 <strstr@plt>
cmp    $0x0,%rax
je     16ca <getDimension+0x50a>
movss  -0x28(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0x98e(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0x97a(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0x946(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x4(%rbp)
jmp    18c7 <getDimension+0x707>
lea    -0x20(%rbp),%rdi
lea    0xa1b(%rip),%rsi
call   10e0 <strstr@plt>
cmp    $0x0,%rax
je     1729 <getDimension+0x569>
movss  -0x28(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0x93b(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0x927(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0x913(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0x8e7(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x4(%rbp)
jmp    18c7 <getDimension+0x707>
lea    -0x20(%rbp),%rdi
lea    0x9bf(%rip),%rsi
call   10e0 <strstr@plt>
cmp    $0x0,%rax
je     1770 <getDimension+0x5b0>
movss  -0x28(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0x8c4(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0x8a0(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x4(%rbp)
jmp    18c7 <getDimension+0x707>
lea    -0x20(%rbp),%rdi
lea    0x97b(%rip),%rsi
call   10e0 <strstr@plt>
cmp    $0x0,%rax
je     17c3 <getDimension+0x603>
movss  -0x28(%rbp),%xmm0
movss  %xmm0,-0x40(%rbp)
mov    $0x0,%al
call   10a0 <CurrentFontSize@plt>
movaps %xmm0,%xmm1
movss  -0x40(%rbp),%xmm0
mulss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0x85d(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x4(%rbp)
jmp    18c7 <getDimension+0x707>
lea    -0x20(%rbp),%rdi
lea    0x92b(%rip),%rsi
call   10e0 <strstr@plt>
cmp    $0x0,%rax
je     1806 <getDimension+0x646>
movss  -0x28(%rbp),%xmm0
movss  %xmm0,-0x44(%rbp)
mov    $0x0,%al
call   10a0 <CurrentFontSize@plt>
movaps %xmm0,%xmm1
movss  -0x44(%rbp),%xmm0
mulss  %xmm1,%xmm0
cvttss2si %xmm0,%eax
mov    %eax,-0x4(%rbp)
jmp    18c7 <getDimension+0x707>
lea    -0x20(%rbp),%rdi
lea    0x8d0(%rip),%rsi
call   10e0 <strstr@plt>
cmp    $0x0,%rax
je     184d <getDimension+0x68d>
movss  -0x28(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0x7d7(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0x7c3(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x4(%rbp)
jmp    18c7 <getDimension+0x707>
movsbl -0x1f(%rbp),%edi
call   1050 <ungetTexChar@plt>
movsbl -0x20(%rbp),%edi
call   1050 <ungetTexChar@plt>
cvttss2si -0x28(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    18c7 <getDimension+0x707>
movsbl -0x20(%rbp),%edi
call   1050 <ungetTexChar@plt>
mov    $0x0,%al
call   10c0 <getSimpleCommand@plt>
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rdx
mov    $0x4,%edi
lea    0x81e(%rip),%rsi
mov    $0x0,%al
call   1070 <diagnostics@plt>
mov    -0x38(%rbp),%rdi
call   10d0 <getLength@plt>
mulss  -0x28(%rbp),%xmm0
movss  %xmm0,-0x28(%rbp)
mov    -0x30(%rbp),%rdi
call   1030 <free@plt>
cvttss2si -0x28(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getDimension>:
push   %rbp
push   %r14
push   %rbx
sub    $0x30,%rsp
xor    %eax,%eax
call   10b0 <skipSpaces@plt>
xor    %eax,%eax
call   1060 <getTexChar@plt>
mov    %eax,%ebp
cmp    $0x74,%al
je     11ea <getDimension+0x2a>
cmp    $0x73,%bpl
je     1200 <getDimension+0x40>
cmp    $0x2d,%bpl
jne    1232 <getDimension+0x72>
jmp    123a <getDimension+0x7a>
xor    %eax,%eax
call   1060 <getTexChar@plt>
xor    %eax,%eax
call   1060 <getTexChar@plt>
mov    %eax,%ebp
cmp    $0x73,%bpl
jne    11e2 <getDimension+0x22>
xor    %eax,%eax
call   1060 <getTexChar@plt>
xor    %eax,%eax
call   1060 <getTexChar@plt>
xor    %eax,%eax
call   1060 <getTexChar@plt>
xor    %eax,%eax
call   1060 <getTexChar@plt>
xor    %eax,%eax
call   1060 <getTexChar@plt>
xor    %eax,%eax
call   1060 <getTexChar@plt>
mov    %eax,%ebp
cmp    $0x2d,%bpl
je     123a <getDimension+0x7a>
xor    %ebx,%ebx
cmp    $0x2b,%bpl
jne    1254 <getDimension+0x94>
mov    %bpl,0x10(%rsp)
xor    %eax,%eax
call   10b0 <skipSpaces@plt>
xor    %eax,%eax
call   1060 <getTexChar@plt>
mov    %eax,%ebp
mov    $0x1,%ebx
cmp    $0x5c,%bpl
jne    1269 <getDimension+0xa9>
mov    %ebx,%eax
add    $0x1,%ebx
movb   $0x31,0x10(%rsp,%rax,1)
mov    $0x5c,%bpl
jmp    12c0 <getDimension+0x100>
mov    %ebx,%ebx
mov    $0x2e,%r14d
jmp    12a3 <getDimension+0xe3>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
cmp    $0x2c,%bpl
movzbl %bpl,%eax
cmove  %r14d,%eax
mov    %al,0x10(%rsp,%rbx,1)
add    $0x1,%rbx
xor    %eax,%eax
call   1060 <getTexChar@plt>
mov    %eax,%ebp
cmp    $0x13,%rbx
je     12bb <getDimension+0xfb>
movsbl %bpl,%edi
call   1040 <isdigit@plt>
test   %rax,%rax
jne    1280 <getDimension+0xc0>
mov    %ebp,%eax
or     $0x2,%al
cmp    $0x2e,%al
je     1280 <getDimension+0xc0>
jmp    12c0 <getDimension+0x100>
mov    $0x13,%ebx
movsbl %bpl,%edi
call   1050 <ungetTexChar@plt>
movslq %ebx,%rbp
movb   $0x0,0x10(%rsp,%rbp,1)
lea    0xd80(%rip),%rsi
xor    %ebx,%ebx
lea    0x10(%rsp),%rdx
mov    $0x4,%edi
xor    %eax,%eax
call   1070 <diagnostics@plt>
cmp    $0x13,%ebp
je     1397 <getDimension+0x1d7>
lea    0xd7f(%rip),%rsi
lea    0x10(%rsp),%rdi
lea    0xc(%rsp),%rdx
call   1090 <sscanf@plt>
cmp    $0x1,%eax
jne    1397 <getDimension+0x1d7>
xor    %eax,%eax
call   10b0 <skipSpaces@plt>
xor    %eax,%eax
call   1060 <getTexChar@plt>
movsbl %al,%edi
call   1080 <tolower@plt>
mov    %al,0x10(%rsp)
cmp    $0x74,%al
je     13cd <getDimension+0x20d>
test   %al,%al
je     144b <getDimension+0x28b>
cmp    $0x5c,%al
jne    1404 <getDimension+0x244>
mov    $0x5c,%edi
call   1050 <ungetTexChar@plt>
xor    %eax,%eax
call   10c0 <getSimpleCommand@plt>
mov    %rax,%r14
lea    0x1(%rax),%rbx
lea    0xd56(%rip),%rsi
mov    $0x4,%edi
mov    %rbx,%rdx
xor    %eax,%eax
call   1070 <diagnostics@plt>
mov    %rbx,%rdi
call   10d0 <getLength@plt>
mulss  0xc(%rsp),%xmm0
movss  %xmm0,0xc(%rsp)
mov    %r14,%rdi
call   1030 <free@plt>
cvttss2si 0xc(%rsp),%ebx
jmp    13c2 <getDimension+0x202>
lea    0xcdf(%rip),%rsi
mov    $0x1,%edi
xor    %eax,%eax
call   1070 <diagnostics@plt>
lea    0xceb(%rip),%rsi
lea    0x10(%rsp),%rdx
mov    $0x1,%edi
xor    %eax,%eax
call   1070 <diagnostics@plt>
mov    %ebx,%eax
add    $0x30,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret
xor    %eax,%eax
call   1060 <getTexChar@plt>
xor    %eax,%eax
call   1060 <getTexChar@plt>
xor    %eax,%eax
call   1060 <getTexChar@plt>
xor    %eax,%eax
call   10b0 <skipSpaces@plt>
xor    %eax,%eax
call   1060 <getTexChar@plt>
movsbl %al,%edi
call   1080 <tolower@plt>
mov    %al,0x10(%rsp)
cmp    $0x5c,%al
je     1345 <getDimension+0x185>
xor    %eax,%eax
call   1060 <getTexChar@plt>
movsbl %al,%edi
call   1080 <tolower@plt>
mov    %al,0x11(%rsp)
movb   $0x0,0x12(%rsp)
lea    0xc97(%rip),%rsi
lea    0x10(%rsp),%rbx
mov    $0x4,%edi
mov    %rbx,%rdx
xor    %eax,%eax
call   1070 <diagnostics@plt>
lea    0xc9d(%rip),%rsi
mov    %rbx,%rdi
call   10e0 <strstr@plt>
test   %rax,%rax
je     1462 <getDimension+0x2a2>
movss  0xc(%rsp),%xmm0
mulss  0xba7(%rip),%xmm0
cvttss2si %xmm0,%ebx
jmp    13c2 <getDimension+0x202>
lea    0xc75(%rip),%rsi
lea    0x10(%rsp),%rdi
call   10e0 <strstr@plt>
test   %rax,%rax
je     1488 <getDimension+0x2c8>
movss  0xc(%rsp),%xmm0
mulss  0xb7e(%rip),%xmm0
jmp    1451 <getDimension+0x291>
lea    0xc52(%rip),%rsi
lea    0x10(%rsp),%rdi
call   10e0 <strstr@plt>
test   %rax,%rax
je     14b5 <getDimension+0x2f5>
movss  0xc(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  0xb58(%rip),%xmm0
jmp    1594 <getDimension+0x3d4>
lea    0xc28(%rip),%rsi
lea    0x10(%rsp),%rdi
call   10e0 <strstr@plt>
test   %rax,%rax
je     14ea <getDimension+0x32a>
movss  0xc(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  0xb2b(%rip),%xmm0
divsd  0xb33(%rip),%xmm0
jmp    1594 <getDimension+0x3d4>
lea    0xbf6(%rip),%rsi
lea    0x10(%rsp),%rdi
call   10e0 <strstr@plt>
test   %rax,%rax
je     151c <getDimension+0x35c>
movss  0xc(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  0xaf6(%rip),%xmm0
divsd  0xb06(%rip),%xmm0
jmp    1594 <getDimension+0x3d4>
lea    0xbc7(%rip),%rsi
lea    0x10(%rsp),%rdi
call   10e0 <strstr@plt>
test   %rax,%rax
je     154e <getDimension+0x38e>
movss  0xc(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  0xac4(%rip),%xmm0
divsd  0xadc(%rip),%xmm0
jmp    1594 <getDimension+0x3d4>
lea    0xb98(%rip),%rsi
lea    0x10(%rsp),%rdi
call   10e0 <strstr@plt>
test   %rax,%rax
jne    157a <getDimension+0x3ba>
lea    0xb82(%rip),%rsi
lea    0x10(%rsp),%rdi
call   10e0 <strstr@plt>
test   %rax,%rax
je     15a5 <getDimension+0x3e5>
movss  0xc(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  0xaa4(%rip),%xmm0
divsd  0xaa4(%rip),%xmm0
mulsd  0xa74(%rip),%xmm0
cvttsd2si %xmm0,%ebx
jmp    13c2 <getDimension+0x202>
lea    0xb44(%rip),%rsi
lea    0x10(%rsp),%rdi
call   10e0 <strstr@plt>
test   %rax,%rax
je     15df <getDimension+0x41f>
movss  0xc(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  0xa63(%rip),%xmm0
divsd  0xa63(%rip),%xmm0
mulsd  0xa63(%rip),%xmm0
jmp    1594 <getDimension+0x3d4>
lea    0xb0d(%rip),%rsi
lea    0x10(%rsp),%rdi
call   10e0 <strstr@plt>
test   %rax,%rax
je     1609 <getDimension+0x449>
movss  0xc(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  0xa41(%rip),%xmm0
jmp    1594 <getDimension+0x3d4>
lea    0xae6(%rip),%rsi
lea    0x10(%rsp),%rdi
call   10e0 <strstr@plt>
test   %rax,%rax
je     164d <getDimension+0x48d>
movss  0xc(%rsp),%xmm0
movss  %xmm0,0x2c(%rsp)
xor    %eax,%eax
call   10a0 <CurrentFontSize@plt>
mulss  0x2c(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  0xa0c(%rip),%xmm0
cvttsd2si %xmm0,%ebx
jmp    13c2 <getDimension+0x202>
lea    0xaa5(%rip),%rsi
lea    0x10(%rsp),%rdi
call   10e0 <strstr@plt>
test   %rax,%rax
je     1685 <getDimension+0x4c5>
movss  0xc(%rsp),%xmm0
movss  %xmm0,0x2c(%rsp)
xor    %eax,%eax
call   10a0 <CurrentFontSize@plt>
mulss  0x2c(%rsp),%xmm0
cvttss2si %xmm0,%ebx
jmp    13c2 <getDimension+0x202>
lea    0xa55(%rip),%rsi
lea    0x10(%rsp),%rdi
call   10e0 <strstr@plt>
test   %rax,%rax
jne    149e <getDimension+0x2de>
movsbl 0x11(%rsp),%edi
call   1050 <ungetTexChar@plt>
movsbl 0x10(%rsp),%edi
call   1050 <ungetTexChar@plt>
jmp    138f <getDimension+0x1cf>

LLVM IR (-O0):
@.str = [34 x i8] c"getDimension() raw number is <%s>\00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [31 x i8] c"Screwy number in TeX dimension\00"
@.str.3 = [30 x i8] c"getDimension() number is <%s>\00"
@.str.4 = [33 x i8] c"getDimension() dimension is <%s>\00"
@.str.5 = [3 x i8] c"pt\00"
@.str.6 = [3 x i8] c"pc\00"
@.str.7 = [3 x i8] c"in\00"
@.str.8 = [3 x i8] c"bp\00"
@.str.9 = [3 x i8] c"cm\00"
@.str.10 = [3 x i8] c"mm\00"
@.str.11 = [3 x i8] c"dd\00"
@.str.12 = [3 x i8] c"cc\00"
@.str.13 = [3 x i8] c"sp\00"
@.str.14 = [3 x i8] c"ex\00"
@.str.15 = [3 x i8] c"em\00"
define i32 @getDimension() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca [20 x i8]
%4 = alloca i32
%5 = alloca float
%6 = alloca i8*
%7 = alloca i8*
store i32 0, i32* %4
%8 = call i32 (...) @skipSpaces()
%9 = call signext i8 (...) @getTexChar()
store i8 %9, i8* %2
%10 = load i8, i8* %2
%11 = sext i8 %10 to i32
%12 = icmp eq i32 %11, 116
br i1 %12, label %13, label %16
13: ; preds = %0
%14 = call signext i8 (...) @getTexChar()
%15 = call signext i8 (...) @getTexChar()
store i8 %15, i8* %2
br label %16
16: ; preds = %13, %0
%17 = load i8, i8* %2
%18 = sext i8 %17 to i32
%19 = icmp eq i32 %18, 115
br i1 %19, label %20, label %27
20: ; preds = %16
%21 = call signext i8 (...) @getTexChar()
%22 = call signext i8 (...) @getTexChar()
%23 = call signext i8 (...) @getTexChar()
%24 = call signext i8 (...) @getTexChar()
%25 = call signext i8 (...) @getTexChar()
%26 = call signext i8 (...) @getTexChar()
store i8 %26, i8* %2
br label %27
27: ; preds = %20, %16
%28 = load i8, i8* %2
%29 = sext i8 %28 to i32
%30 = icmp eq i32 %29, 45
br i1 %30, label %35, label %31
31: ; preds = %27
%32 = load i8, i8* %2
%33 = sext i8 %32 to i32
%34 = icmp eq i32 %33, 43
br i1 %34, label %35, label %43
35: ; preds = %31, %27
%36 = load i8, i8* %2
%37 = load i32, i32* %4
%38 = add nsw i32 %37, 1
store i32 %38, i32* %4
%39 = sext i32 %37 to i64
%40 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 %39
store i8 %36, i8* %40
%41 = call i32 (...) @skipSpaces()
%42 = call signext i8 (...) @getTexChar()
store i8 %42, i8* %2
br label %43
43: ; preds = %35, %31
%44 = load i8, i8* %2
%45 = sext i8 %44 to i32
%46 = icmp eq i32 %45, 92
br i1 %46, label %47, label %52
47: ; preds = %43
%48 = load i32, i32* %4
%49 = add nsw i32 %48, 1
store i32 %49, i32* %4
%50 = sext i32 %48 to i64
%51 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 %50
store i8 49, i8* %51
br label %86
52: ; preds = %43
br label %53
53: ; preds = %78, %52
%54 = load i32, i32* %4
%55 = icmp slt i32 %54, 19
br i1 %55, label %56, label %71
56: ; preds = %53
%57 = load i8, i8* %2
%58 = sext i8 %57 to i32
%59 = call i64 @isdigit(i32 %58)
%60 = icmp ne i64 %59, 0
br i1 %60, label %69, label %61
61: ; preds = %56
%62 = load i8, i8* %2
%63 = sext i8 %62 to i32
%64 = icmp eq i32 %63, 46
br i1 %64, label %69, label %65
65: ; preds = %61
%66 = load i8, i8* %2
%67 = sext i8 %66 to i32
%68 = icmp eq i32 %67, 44
br label %69
69: ; preds = %65, %61, %56
%70 = phi i1 [ true, %61 ], [ true, %56 ], [ %68, %65 ]
br label %71
71: ; preds = %69, %53
%72 = phi i1 [ false, %53 ], [ %70, %69 ]
br i1 %72, label %73, label %85
73: ; preds = %71
%74 = load i8, i8* %2
%75 = sext i8 %74 to i32
%76 = icmp eq i32 %75, 44
br i1 %76, label %77, label %78
77: ; preds = %73
store i8 46, i8* %2
br label %78
78: ; preds = %77, %73
%79 = load i8, i8* %2
%80 = load i32, i32* %4
%81 = add nsw i32 %80, 1
store i32 %81, i32* %4
%82 = sext i32 %80 to i64
%83 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 %82
store i8 %79, i8* %83
%84 = call signext i8 (...) @getTexChar()
store i8 %84, i8* %2
br label %53
85: ; preds = %71
br label %86
86: ; preds = %85, %47
%87 = load i8, i8* %2
%88 = call i32 @ungetTexChar(i8 signext %87)
%89 = load i32, i32* %4
%90 = sext i32 %89 to i64
%91 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 %90
store i8 0, i8* %91
%92 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%93 = call i32 (i32, i8*, ...) @diagnostics(i32 4, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %92)
%94 = load i32, i32* %4
%95 = icmp eq i32 %94, 19
br i1 %95, label %100, label %96
96: ; preds = %86
%97 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%98 = call i32 @sscanf(i8* %97, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %5)
%99 = icmp ne i32 %98, 1
br i1 %99, label %100, label %104
100: ; preds = %96, %86
%101 = call i32 (i32, i8*, ...) @diagnostics(i32 1, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0))
%102 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%103 = call i32 (i32, i8*, ...) @diagnostics(i32 1, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0), i8* %102)
store i32 0, i32* %1
br label %304
104: ; preds = %96
%105 = call i32 (...) @skipSpaces()
%106 = call signext i8 (...) @getTexChar()
%107 = sext i8 %106 to i32
%108 = call signext i8 @tolower(i32 %107)
%109 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
store i8 %108, i8* %109
%110 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%111 = load i8, i8* %110
%112 = sext i8 %111 to i32
%113 = icmp eq i32 %112, 0
br i1 %113, label %114, label %118
114: ; preds = %104
%115 = load float, float* %5
%116 = fmul float %115, 2.000000e+01
%117 = fptosi float %116 to i32
store i32 %117, i32* %1
br label %304
118: ; preds = %104
%119 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%120 = load i8, i8* %119
%121 = sext i8 %120 to i32
%122 = icmp eq i32 %121, 116
br i1 %122, label %123, label %132
123: ; preds = %118
%124 = call signext i8 (...) @getTexChar()
%125 = call signext i8 (...) @getTexChar()
%126 = call signext i8 (...) @getTexChar()
%127 = call i32 (...) @skipSpaces()
%128 = call signext i8 (...) @getTexChar()
%129 = sext i8 %128 to i32
%130 = call signext i8 @tolower(i32 %129)
%131 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
store i8 %130, i8* %131
br label %132
132: ; preds = %123, %118
%133 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%134 = load i8, i8* %133
%135 = sext i8 %134 to i32
%136 = icmp ne i32 %135, 92
br i1 %136, label %137, label %287
137: ; preds = %132
%138 = call signext i8 (...) @getTexChar()
%139 = sext i8 %138 to i32
%140 = call signext i8 @tolower(i32 %139)
%141 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 1
store i8 %140, i8* %141
%142 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 2
store i8 0, i8* %142
%143 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%144 = call i32 (i32, i8*, ...) @diagnostics(i32 4, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.4, i64 0, i64 0), i8* %143)
%145 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%146 = call i64 @strstr(i8* %145, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%147 = icmp ne i64 %146, 0
br i1 %147, label %148, label %152
148: ; preds = %137
%149 = load float, float* %5
%150 = fmul float %149, 2.000000e+01
%151 = fptosi float %150 to i32
store i32 %151, i32* %1
br label %304
152: ; preds = %137
%153 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%154 = call i64 @strstr(i8* %153, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
%155 = icmp ne i64 %154, 0
br i1 %155, label %156, label %161
156: ; preds = %152
%157 = load float, float* %5
%158 = fmul float %157, 1.200000e+01
%159 = fmul float %158, 2.000000e+01
%160 = fptosi float %159 to i32
store i32 %160, i32* %1
br label %304
161: ; preds = %152
%162 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%163 = call i64 @strstr(i8* %162, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0))
%164 = icmp ne i64 %163, 0
br i1 %164, label %165, label %171
165: ; preds = %161
%166 = load float, float* %5
%167 = fpext float %166 to double
%168 = fmul double %167, 7.227000e+01
%169 = fmul double %168, 2.000000e+01
%170 = fptosi double %169 to i32
store i32 %170, i32* %1
br label %304
171: ; preds = %161
%172 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%173 = call i64 @strstr(i8* %172, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0))
%174 = icmp ne i64 %173, 0
br i1 %174, label %175, label %182
175: ; preds = %171
%176 = load float, float* %5
%177 = fpext float %176 to double
%178 = fmul double %177, 7.227000e+01
%179 = fdiv double %178, 7.200000e+01
%180 = fmul double %179, 2.000000e+01
%181 = fptosi double %180 to i32
store i32 %181, i32* %1
br label %304
182: ; preds = %171
%183 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%184 = call i64 @strstr(i8* %183, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0))
%185 = icmp ne i64 %184, 0
br i1 %185, label %186, label %193
186: ; preds = %182
%187 = load float, float* %5
%188 = fpext float %187 to double
%189 = fmul double %188, 7.227000e+01
%190 = fdiv double %189, 2.540000e+00
%191 = fmul double %190, 2.000000e+01
%192 = fptosi double %191 to i32
store i32 %192, i32* %1
br label %304
193: ; preds = %182
%194 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%195 = call i64 @strstr(i8* %194, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0))
%196 = icmp ne i64 %195, 0
br i1 %196, label %197, label %204
197: ; preds = %193
%198 = load float, float* %5
%199 = fpext float %198 to double
%200 = fmul double %199, 7.227000e+01
%201 = fdiv double %200, 2.540000e+01
%202 = fmul double %201, 2.000000e+01
%203 = fptosi double %202 to i32
store i32 %203, i32* %1
br label %304
204: ; preds = %193
%205 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%206 = call i64 @strstr(i8* %205, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0))
%207 = icmp ne i64 %206, 0
br i1 %207, label %208, label %215
208: ; preds = %204
%209 = load float, float* %5
%210 = fpext float %209 to double
%211 = fmul double %210, 1.238000e+03
%212 = fdiv double %211, 1.157000e+03
%213 = fmul double %212, 2.000000e+01
%214 = fptosi double %213 to i32
store i32 %214, i32* %1
br label %304
215: ; preds = %204
%216 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%217 = call i64 @strstr(i8* %216, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0))
%218 = icmp ne i64 %217, 0
br i1 %218, label %219, label %226
219: ; preds = %215
%220 = load float, float* %5
%221 = fpext float %220 to double
%222 = fmul double %221, 1.238000e+03
%223 = fdiv double %222, 1.157000e+03
%224 = fmul double %223, 2.000000e+01
%225 = fptosi double %224 to i32
store i32 %225, i32* %1
br label %304
226: ; preds = %215
%227 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%228 = call i64 @strstr(i8* %227, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i64 0, i64 0))
%229 = icmp ne i64 %228, 0
br i1 %229, label %230, label %238
230: ; preds = %226
%231 = load float, float* %5
%232 = fpext float %231 to double
%233 = fmul double %232, 1.238000e+03
%234 = fdiv double %233, 1.157000e+03
%235 = fmul double %234, 1.200000e+01
%236 = fmul double %235, 2.000000e+01
%237 = fptosi double %236 to i32
store i32 %237, i32* %1
br label %304
238: ; preds = %226
%239 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%240 = call i64 @strstr(i8* %239, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.13, i64 0, i64 0))
%241 = icmp ne i64 %240, 0
br i1 %241, label %242, label %248
242: ; preds = %238
%243 = load float, float* %5
%244 = fpext float %243 to double
%245 = fdiv double %244, 6.553600e+04
%246 = fmul double %245, 2.000000e+01
%247 = fptosi double %246 to i32
store i32 %247, i32* %1
br label %304
248: ; preds = %238
%249 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%250 = call i64 @strstr(i8* %249, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.14, i64 0, i64 0))
%251 = icmp ne i64 %250, 0
br i1 %251, label %252, label %259
252: ; preds = %248
%253 = load float, float* %5
%254 = call float (...) @CurrentFontSize()
%255 = fmul float %253, %254
%256 = fpext float %255 to double
%257 = fmul double %256, 5.000000e-01
%258 = fptosi double %257 to i32
store i32 %258, i32* %1
br label %304
259: ; preds = %248
%260 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%261 = call i64 @strstr(i8* %260, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.15, i64 0, i64 0))
%262 = icmp ne i64 %261, 0
br i1 %262, label %263, label %268
263: ; preds = %259
%264 = load float, float* %5
%265 = call float (...) @CurrentFontSize()
%266 = fmul float %264, %265
%267 = fptosi float %266 to i32
store i32 %267, i32* %1
br label %304
268: ; preds = %259
%269 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%270 = call i64 @strstr(i8* %269, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0))
%271 = icmp ne i64 %270, 0
br i1 %271, label %272, label %278
272: ; preds = %268
%273 = load float, float* %5
%274 = fpext float %273 to double
%275 = fmul double %274, 7.227000e+01
%276 = fmul double %275, 2.000000e+01
%277 = fptosi double %276 to i32
store i32 %277, i32* %1
br label %304
278: ; preds = %268
%279 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 1
%280 = load i8, i8* %279
%281 = call i32 @ungetTexChar(i8 signext %280)
%282 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%283 = load i8, i8* %282
%284 = call i32 @ungetTexChar(i8 signext %283)
%285 = load float, float* %5
%286 = fptosi float %285 to i32
store i32 %286, i32* %1
br label %304
287: ; preds = %132
%288 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%289 = load i8, i8* %288
%290 = call i32 @ungetTexChar(i8 signext %289)
%291 = call i8* (...) @getSimpleCommand()
store i8* %291, i8** %6
%292 = load i8*, i8** %6
%293 = getelementptr inbounds i8, i8* %292, i64 1
store i8* %293, i8** %7
%294 = load i8*, i8** %7
%295 = call i32 (i32, i8*, ...) @diagnostics(i32 4, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.4, i64 0, i64 0), i8* %294)
%296 = load i8*, i8** %7
%297 = call float @getLength(i8* %296)
%298 = load float, float* %5
%299 = fmul float %298, %297
store float %299, float* %5
%300 = load i8*, i8** %6
%301 = call i32 @free(i8* %300)
%302 = load float, float* %5
%303 = fptosi float %302 to i32
store i32 %303, i32* %1
br label %304
304: ; preds = %287, %278, %272, %263, %252, %242, %230, %219, %208, %197, %186, %175, %165, %156, %148, %114, %100
%305 = load i32, i32* %1
ret i32 %305
}

LLVM IR (-O2):
@.str = [34 x i8] c"getDimension() raw number is <%s>\00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [31 x i8] c"Screwy number in TeX dimension\00"
@.str.3 = [30 x i8] c"getDimension() number is <%s>\00"
@.str.4 = [33 x i8] c"getDimension() dimension is <%s>\00"
@.str.5 = [3 x i8] c"pt\00"
@.str.6 = [3 x i8] c"pc\00"
@.str.7 = [3 x i8] c"in\00"
@.str.8 = [3 x i8] c"bp\00"
@.str.9 = [3 x i8] c"cm\00"
@.str.10 = [3 x i8] c"mm\00"
@.str.11 = [3 x i8] c"dd\00"
@.str.12 = [3 x i8] c"cc\00"
@.str.13 = [3 x i8] c"sp\00"
@.str.14 = [3 x i8] c"ex\00"
@.str.15 = [3 x i8] c"em\00"
define i32 @getDimension() {
%1 = alloca [20 x i8]
%2 = alloca float
%3 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%4 = bitcast float* %2 to i8*
%5 = tail call i32 (...) @skipSpaces()
%6 = tail call signext i8 (...) @getTexChar()
%7 = icmp eq i8 %6, 116
br i1 %7, label %8, label %11
8: ; preds = %0
%9 = tail call signext i8 (...) @getTexChar()
%10 = tail call signext i8 (...) @getTexChar()
br label %11
11: ; preds = %8, %0
%12 = phi i8 [ %10, %8 ], [ %6, %0 ]
%13 = icmp eq i8 %12, 115
br i1 %13, label %14, label %21
14: ; preds = %11
%15 = tail call signext i8 (...) @getTexChar()
%16 = tail call signext i8 (...) @getTexChar()
%17 = tail call signext i8 (...) @getTexChar()
%18 = tail call signext i8 (...) @getTexChar()
%19 = tail call signext i8 (...) @getTexChar()
%20 = tail call signext i8 (...) @getTexChar()
br label %21
21: ; preds = %14, %11
%22 = phi i8 [ %20, %14 ], [ %12, %11 ]
switch i8 %22, label %26 [
i8 45, label %23
i8 43, label %23
]
23: ; preds = %21, %21
store i8 %22, i8* %3
%24 = tail call i32 (...) @skipSpaces()
%25 = tail call signext i8 (...) @getTexChar()
br label %26
26: ; preds = %21, %23
%27 = phi i32 [ 1, %23 ], [ 0, %21 ]
%28 = phi i8 [ %25, %23 ], [ %22, %21 ]
%29 = icmp eq i8 %28, 92
br i1 %29, label %32, label %30
30: ; preds = %26
%31 = zext i32 %27 to i64
br label %36
32: ; preds = %26
%33 = add nuw nsw i32 %27, 1
%34 = zext i32 %27 to i64
%35 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 %34
store i8 49, i8* %35
br label %53
36: ; preds = %30, %45
%37 = phi i64 [ %31, %30 ], [ %47, %45 ]
%38 = phi i8 [ %28, %30 ], [ %49, %45 ]
%39 = sext i8 %38 to i32
%40 = tail call i64 @isdigit(i32 %39)
%41 = freeze i64 %40
%42 = icmp eq i64 %41, 0
%43 = icmp eq i8 %38, 44
br i1 %42, label %44, label %45
44: ; preds = %36
switch i8 %38, label %51 [
i8 46, label %45
i8 44, label %45
]
45: ; preds = %44, %44, %36
%46 = select i1 %43, i8 46, i8 %38
%47 = add nuw nsw i64 %37, 1
%48 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 %37
store i8 %46, i8* %48
%49 = tail call signext i8 (...) @getTexChar()
%50 = icmp eq i64 %47, 19
br i1 %50, label %53, label %36
51: ; preds = %44
%52 = trunc i64 %37 to i32
br label %53
53: ; preds = %45, %51, %32
%54 = phi i32 [ %33, %32 ], [ %52, %51 ], [ 19, %45 ]
%55 = phi i8 [ 92, %32 ], [ %38, %51 ], [ %49, %45 ]
%56 = tail call i32 @ungetTexChar(i8 signext %55)
%57 = sext i32 %54 to i64
%58 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 %57
store i8 0, i8* %58
%59 = call i32 (i32, i8*, ...) @diagnostics(i32 4, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %3)
%60 = icmp eq i32 %54, 19
br i1 %60, label %64, label %61
61: ; preds = %53
%62 = call i32 @sscanf(i8* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
%63 = icmp eq i32 %62, 1
br i1 %63, label %67, label %64
64: ; preds = %61, %53
%65 = call i32 (i32, i8*, ...) @diagnostics(i32 1, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0))
%66 = call i32 (i32, i8*, ...) @diagnostics(i32 1, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0), i8* %3)
br label %232
67: ; preds = %61
%68 = call i32 (...) @skipSpaces()
%69 = call signext i8 (...) @getTexChar()
%70 = sext i8 %69 to i32
%71 = call signext i8 @tolower(i32 %70)
store i8 %71, i8* %3
switch i8 %71, label %84 [
i8 0, label %72
i8 116, label %76
]
72: ; preds = %67
%73 = load float, float* %2
%74 = fmul float %73, 2.000000e+01
%75 = fptosi float %74 to i32
br label %232
76: ; preds = %67
%77 = call signext i8 (...) @getTexChar()
%78 = call signext i8 (...) @getTexChar()
%79 = call signext i8 (...) @getTexChar()
%80 = call i32 (...) @skipSpaces()
%81 = call signext i8 (...) @getTexChar()
%82 = sext i8 %81 to i32
%83 = call signext i8 @tolower(i32 %82)
store i8 %83, i8* %3
br label %84
84: ; preds = %67, %76
%85 = phi i8 [ %71, %67 ], [ %83, %76 ]
%86 = icmp eq i8 %85, 92
br i1 %86, label %221, label %87
87: ; preds = %84
%88 = call signext i8 (...) @getTexChar()
%89 = sext i8 %88 to i32
%90 = call signext i8 @tolower(i32 %89)
%91 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 1
store i8 %90, i8* %91
%92 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 2
store i8 0, i8* %92
%93 = call i32 (i32, i8*, ...) @diagnostics(i32 4, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.4, i64 0, i64 0), i8* %3)
%94 = call i64 @strstr(i8* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%95 = icmp eq i64 %94, 0
br i1 %95, label %100, label %96
96: ; preds = %87
%97 = load float, float* %2
%98 = fmul float %97, 2.000000e+01
%99 = fptosi float %98 to i32
br label %232
100: ; preds = %87
%101 = call i64 @strstr(i8* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
%102 = icmp eq i64 %101, 0
br i1 %102, label %108, label %103
103: ; preds = %100
%104 = load float, float* %2
%105 = fmul float %104, 1.200000e+01
%106 = fmul float %105, 2.000000e+01
%107 = fptosi float %106 to i32
br label %232
108: ; preds = %100
%109 = call i64 @strstr(i8* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0))
%110 = icmp eq i64 %109, 0
br i1 %110, label %117, label %111
111: ; preds = %108
%112 = load float, float* %2
%113 = fpext float %112 to double
%114 = fmul double %113, 7.227000e+01
%115 = fmul double %114, 2.000000e+01
%116 = fptosi double %115 to i32
br label %232
117: ; preds = %108
%118 = call i64 @strstr(i8* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0))
%119 = icmp eq i64 %118, 0
br i1 %119, label %127, label %120
120: ; preds = %117
%121 = load float, float* %2
%122 = fpext float %121 to double
%123 = fmul double %122, 7.227000e+01
%124 = fdiv double %123, 7.200000e+01
%125 = fmul double %124, 2.000000e+01
%126 = fptosi double %125 to i32
br label %232
127: ; preds = %117
%128 = call i64 @strstr(i8* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0))
%129 = icmp eq i64 %128, 0
br i1 %129, label %137, label %130
130: ; preds = %127
%131 = load float, float* %2
%132 = fpext float %131 to double
%133 = fmul double %132, 7.227000e+01
%134 = fdiv double %133, 2.540000e+00
%135 = fmul double %134, 2.000000e+01
%136 = fptosi double %135 to i32
br label %232
137: ; preds = %127
%138 = call i64 @strstr(i8* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0))
%139 = icmp eq i64 %138, 0
br i1 %139, label %147, label %140
140: ; preds = %137
%141 = load float, float* %2
%142 = fpext float %141 to double
%143 = fmul double %142, 7.227000e+01
%144 = fdiv double %143, 2.540000e+01
%145 = fmul double %144, 2.000000e+01
%146 = fptosi double %145 to i32
br label %232
147: ; preds = %137
%148 = call i64 @strstr(i8* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0))
%149 = icmp eq i64 %148, 0
br i1 %149, label %157, label %150
150: ; preds = %147
%151 = load float, float* %2
%152 = fpext float %151 to double
%153 = fmul double %152, 1.238000e+03
%154 = fdiv double %153, 1.157000e+03
%155 = fmul double %154, 2.000000e+01
%156 = fptosi double %155 to i32
br label %232
157: ; preds = %147
%158 = call i64 @strstr(i8* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0))
%159 = icmp eq i64 %158, 0
br i1 %159, label %167, label %160
160: ; preds = %157
%161 = load float, float* %2
%162 = fpext float %161 to double
%163 = fmul double %162, 1.238000e+03
%164 = fdiv double %163, 1.157000e+03
%165 = fmul double %164, 2.000000e+01
%166 = fptosi double %165 to i32
br label %232
167: ; preds = %157
%168 = call i64 @strstr(i8* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i64 0, i64 0))
%169 = icmp eq i64 %168, 0
br i1 %169, label %178, label %170
170: ; preds = %167
%171 = load float, float* %2
%172 = fpext float %171 to double
%173 = fmul double %172, 1.238000e+03
%174 = fdiv double %173, 1.157000e+03
%175 = fmul double %174, 1.200000e+01
%176 = fmul double %175, 2.000000e+01
%177 = fptosi double %176 to i32
br label %232
178: ; preds = %167
%179 = call i64 @strstr(i8* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.13, i64 0, i64 0))
%180 = icmp eq i64 %179, 0
br i1 %180, label %187, label %181
181: ; preds = %178
%182 = load float, float* %2
%183 = fpext float %182 to double
%184 = fmul double %183, 0x3EF0000000000000
%185 = fmul double %184, 2.000000e+01
%186 = fptosi double %185 to i32
br label %232
187: ; preds = %178
%188 = call i64 @strstr(i8* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.14, i64 0, i64 0))
%189 = icmp eq i64 %188, 0
br i1 %189, label %197, label %190
190: ; preds = %187
%191 = load float, float* %2
%192 = call float (...) @CurrentFontSize()
%193 = fmul float %191, %192
%194 = fpext float %193 to double
%195 = fmul double %194, 5.000000e-01
%196 = fptosi double %195 to i32
br label %232
197: ; preds = %187
%198 = call i64 @strstr(i8* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.15, i64 0, i64 0))
%199 = icmp eq i64 %198, 0
br i1 %199, label %205, label %200
200: ; preds = %197
%201 = load float, float* %2
%202 = call float (...) @CurrentFontSize()
%203 = fmul float %201, %202
%204 = fptosi float %203 to i32
br label %232
205: ; preds = %197
%206 = call i64 @strstr(i8* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0))
%207 = icmp eq i64 %206, 0
br i1 %207, label %214, label %208
208: ; preds = %205
%209 = load float, float* %2
%210 = fpext float %209 to double
%211 = fmul double %210, 7.227000e+01
%212 = fmul double %211, 2.000000e+01
%213 = fptosi double %212 to i32
br label %232
214: ; preds = %205
%215 = load i8, i8* %91
%216 = call i32 @ungetTexChar(i8 signext %215)
%217 = load i8, i8* %3
%218 = call i32 @ungetTexChar(i8 signext %217)
%219 = load float, float* %2
%220 = fptosi float %219 to i32
br label %232
221: ; preds = %84
%222 = call i32 @ungetTexChar(i8 signext 92)
%223 = call i8* (...) @getSimpleCommand()
%224 = getelementptr inbounds i8, i8* %223, i64 1
%225 = call i32 (i32, i8*, ...) @diagnostics(i32 4, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.4, i64 0, i64 0), i8* %224)
%226 = call float @getLength(i8* %224)
%227 = load float, float* %2
%228 = fmul float %226, %227
store float %228, float* %2
%229 = call i32 @free(i8* %223)
%230 = load float, float* %2
%231 = fptosi float %230 to i32
br label %232
232: ; preds = %221, %214, %208, %200, %190, %181, %170, %160, %150, %140, %130, %120, %111, %103, %96, %72, %64
%233 = phi i32 [ 0, %64 ], [ %75, %72 ], [ %99, %96 ], [ %107, %103 ], [ %116, %111 ], [ %126, %120 ], [ %136, %130 ], [ %146, %140 ], [ %156, %150 ], [ %166, %160 ], [ %177, %170 ], [ %186, %181 ], [ %196, %190 ], [ %204, %200 ], [ %213, %208 ], [ %220, %214 ], [ %231, %221 ]
ret i32 %233
}