#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 */
long get_num(char *, char *);
char *get_string(char *);
int /*<<< orphan*/ halt(char *, char *);
scalar_t__ tt_getCoords(char *, int, int, long, int);
char *macttGetCoords(char *arg) {
  int tbl;
  long top;
  char *tmp;
  int theType;
  top = get_num("ttGetCoords", arg);
  tbl = (int)get_num("ttGetCoords", arg);
  if (*(tmp = get_string(arg)) == 'o') {
    theType = 1;
    tmp++;
  } else
    theType = 0;
  switch (*tmp) {
  case 'e':
    switch (tmp[1]) {
    case 'v':
      switch (tmp[2]) {
      case 'l':
        theType += 4;
        break;
      case '\0':
        theType += 1;
        break;
      default:
        halt("Unexpected '%s'.", arg);
      }
      break;
    case 'l':
      switch (tmp[2]) {
      case 'l':
        theType += 16;
        break;
      case '\0':
        theType += 8;
        break;
      default:
        halt("Unexpected '%s'.", arg);
      }
      break;
    default:
      halt("Unexpected '%s'.", arg);
    }
    break;
  case 'i':
    switch (tmp[1]) {
    case 'v':
      switch (tmp[2]) {
      case 'l':
        theType += 64;
        break;
      case '\0':
        theType += 32;
        break;
      default:
        halt("Unexpected '%s'.", arg);
      }
      break;
    case 'l':
      switch (tmp[2]) {
      case 'l':
        theType += 256;
        break;
      case '\0':
        theType += 128;
        break;
      default:
        halt("Unexpected '%s'.", arg);
      }
      break;
    default:
      halt("Unexpected '%s'.", arg);
    }
    break;
  default:
    halt("Unexpected '%s'.", arg);
  }
  if (tt_getCoords(arg, 10240, tbl, top, theType) < 0)
    *arg = '\0';
  return arg;
}


x86 assembly (clang, -O0):
<macttGetCoords>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xea9(%rip),%rdi
call   1030 <get_num@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xe95(%rip),%rdi
call   1030 <get_num@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <get_string@plt>
mov    %rax,-0x20(%rbp)
movsbl (%rax),%eax
cmp    $0x6f,%eax
jne    11a4 <macttGetCoords+0x64>
movl   $0x1,-0x24(%rbp)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    11ab <macttGetCoords+0x6b>
movl   $0x0,-0x24(%rbp)
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
mov    %eax,-0x28(%rbp)
sub    $0x65,%eax
je     11d4 <macttGetCoords+0x94>
jmp    11c3 <macttGetCoords+0x83>
mov    -0x28(%rbp),%eax
sub    $0x69,%eax
je     12c7 <macttGetCoords+0x187>
jmp    13be <macttGetCoords+0x27e>
mov    -0x20(%rbp),%rax
movsbl 0x1(%rax),%eax
mov    %eax,-0x2c(%rbp)
sub    $0x6c,%eax
je     1258 <macttGetCoords+0x118>
jmp    11ed <macttGetCoords+0xad>
mov    -0x2c(%rbp),%eax
sub    $0x76,%eax
jne    12b2 <macttGetCoords+0x172>
jmp    11fe <macttGetCoords+0xbe>
mov    -0x20(%rbp),%rax
movsbl 0x2(%rax),%eax
mov    %eax,-0x30(%rbp)
test   %eax,%eax
je     1235 <macttGetCoords+0xf5>
jmp    1216 <macttGetCoords+0xd6>
mov    -0x30(%rbp),%eax
sub    $0x6c,%eax
jne    1243 <macttGetCoords+0x103>
jmp    1227 <macttGetCoords+0xe7>
mov    -0x24(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0x24(%rbp)
jmp    1253 <macttGetCoords+0x113>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1253 <macttGetCoords+0x113>
mov    -0x8(%rbp),%rsi
lea    0xdbe(%rip),%rdi
call   1050 <halt@plt>
jmp    12c2 <macttGetCoords+0x182>
mov    -0x20(%rbp),%rax
movsbl 0x2(%rax),%eax
mov    %eax,-0x34(%rbp)
test   %eax,%eax
je     128f <macttGetCoords+0x14f>
jmp    1270 <macttGetCoords+0x130>
mov    -0x34(%rbp),%eax
sub    $0x6c,%eax
jne    129d <macttGetCoords+0x15d>
jmp    1281 <macttGetCoords+0x141>
mov    -0x24(%rbp),%eax
add    $0x10,%eax
mov    %eax,-0x24(%rbp)
jmp    12ad <macttGetCoords+0x16d>
mov    -0x24(%rbp),%eax
add    $0x8,%eax
mov    %eax,-0x24(%rbp)
jmp    12ad <macttGetCoords+0x16d>
mov    -0x8(%rbp),%rsi
lea    0xd64(%rip),%rdi
call   1050 <halt@plt>
jmp    12c2 <macttGetCoords+0x182>
mov    -0x8(%rbp),%rsi
lea    0xd4f(%rip),%rdi
call   1050 <halt@plt>
jmp    13ce <macttGetCoords+0x28e>
mov    -0x20(%rbp),%rax
movsbl 0x1(%rax),%eax
mov    %eax,-0x38(%rbp)
sub    $0x6c,%eax
je     134b <macttGetCoords+0x20b>
jmp    12e0 <macttGetCoords+0x1a0>
mov    -0x38(%rbp),%eax
sub    $0x76,%eax
jne    13a9 <macttGetCoords+0x269>
jmp    12f1 <macttGetCoords+0x1b1>
mov    -0x20(%rbp),%rax
movsbl 0x2(%rax),%eax
mov    %eax,-0x3c(%rbp)
test   %eax,%eax
je     1328 <macttGetCoords+0x1e8>
jmp    1309 <macttGetCoords+0x1c9>
mov    -0x3c(%rbp),%eax
sub    $0x6c,%eax
jne    1336 <macttGetCoords+0x1f6>
jmp    131a <macttGetCoords+0x1da>
mov    -0x24(%rbp),%eax
add    $0x40,%eax
mov    %eax,-0x24(%rbp)
jmp    1346 <macttGetCoords+0x206>
mov    -0x24(%rbp),%eax
add    $0x20,%eax
mov    %eax,-0x24(%rbp)
jmp    1346 <macttGetCoords+0x206>
mov    -0x8(%rbp),%rsi
lea    0xccb(%rip),%rdi
call   1050 <halt@plt>
jmp    13b9 <macttGetCoords+0x279>
mov    -0x20(%rbp),%rax
movsbl 0x2(%rax),%eax
mov    %eax,-0x40(%rbp)
test   %eax,%eax
je     1384 <macttGetCoords+0x244>
jmp    1363 <macttGetCoords+0x223>
mov    -0x40(%rbp),%eax
sub    $0x6c,%eax
jne    1394 <macttGetCoords+0x254>
jmp    1374 <macttGetCoords+0x234>
mov    -0x24(%rbp),%eax
add    $0x100,%eax
mov    %eax,-0x24(%rbp)
jmp    13a4 <macttGetCoords+0x264>
mov    -0x24(%rbp),%eax
add    $0x80,%eax
mov    %eax,-0x24(%rbp)
jmp    13a4 <macttGetCoords+0x264>
mov    -0x8(%rbp),%rsi
lea    0xc6d(%rip),%rdi
call   1050 <halt@plt>
jmp    13b9 <macttGetCoords+0x279>
mov    -0x8(%rbp),%rsi
lea    0xc58(%rip),%rdi
call   1050 <halt@plt>
jmp    13ce <macttGetCoords+0x28e>
mov    -0x8(%rbp),%rsi
lea    0xc43(%rip),%rdi
call   1050 <halt@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    -0x24(%rbp),%r8d
mov    $0x2800,%esi
call   1060 <tt_getCoords@plt>
cmp    $0x0,%rax
jge    13f8 <macttGetCoords+0x2b8>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<macttGetCoords>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdi,%r12
lea    0xeae(%rip),%rbx
mov    %rbx,%rdi
mov    %r12,%rsi
call   1030 <get_num@plt>
mov    %rax,%r14
mov    %rbx,%rdi
mov    %r12,%rsi
call   1030 <get_num@plt>
mov    %rax,%r15
mov    %r12,%rdi
call   1040 <get_string@plt>
mov    (%rax),%cl
xor    %ebx,%ebx
cmp    $0x6f,%cl
sete   %bl
movsbl (%rax,%rbx,1),%edx
cmp    $0x69,%edx
je     11b4 <macttGetCoords+0x74>
cmp    $0x65,%edx
jne    11ff <macttGetCoords+0xbf>
movsbl 0x1(%rax,%rbx,1),%edx
cmp    $0x6c,%edx
je     11d6 <macttGetCoords+0x96>
cmp    $0x76,%edx
jne    11ff <macttGetCoords+0xbf>
movsbl 0x2(%rax,%rbx,1),%eax
test   %eax,%eax
je     123d <macttGetCoords+0xfd>
cmp    $0x6c,%eax
jne    11ff <macttGetCoords+0xbf>
or     $0x4,%ebx
jmp    120e <macttGetCoords+0xce>
movsbl 0x1(%rax,%rbx,1),%ecx
cmp    $0x6c,%ecx
je     11e9 <macttGetCoords+0xa9>
cmp    $0x76,%ecx
jne    11ff <macttGetCoords+0xbf>
movsbl 0x2(%rax,%rbx,1),%eax
test   %eax,%eax
je     124a <macttGetCoords+0x10a>
cmp    $0x6c,%eax
jne    11ff <macttGetCoords+0xbf>
or     $0x40,%ebx
jmp    120e <macttGetCoords+0xce>
movsbl 0x2(%rax,%rbx,1),%eax
test   %eax,%eax
je     124f <macttGetCoords+0x10f>
cmp    $0x6c,%eax
jne    11ff <macttGetCoords+0xbf>
or     $0x10,%ebx
jmp    120e <macttGetCoords+0xce>
movsbl 0x2(%rax,%rbx,1),%eax
test   %eax,%eax
je     1254 <macttGetCoords+0x114>
cmp    $0x6c,%eax
jne    11ff <macttGetCoords+0xbf>
or     $0x100,%ebx
jmp    120e <macttGetCoords+0xce>
lea    0xe06(%rip),%rdi
mov    %r12,%rsi
call   1050 <halt@plt>
mov    %r12,%rdi
mov    $0x2800,%esi
mov    %r15d,%edx
mov    %r14,%rcx
mov    %ebx,%r8d
call   1060 <tt_getCoords@plt>
test   %rax,%rax
jns    122e <macttGetCoords+0xee>
movb   $0x0,(%r12)
mov    %r12,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret
xor    %ebx,%ebx
cmp    $0x6f,%cl
sete   %bl
add    $0x1,%ebx
jmp    120e <macttGetCoords+0xce>
or     $0x20,%ebx
jmp    120e <macttGetCoords+0xce>
or     $0x8,%ebx
jmp    120e <macttGetCoords+0xce>
or     $0x80,%ebx
jmp    120e <macttGetCoords+0xce>

LLVM IR (-O0):
@.str = [12 x i8] c"ttGetCoords\00"
@.str.1 = [17 x i8] c"Unexpected '%s'.\00"
define i8* @macttGetCoords(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i64
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %2
%7 = load i8*, i8** %2
%8 = call i64 @get_num(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %7)
store i64 %8, i64* %4
%9 = load i8*, i8** %2
%10 = call i64 @get_num(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = trunc i64 %10 to i32
store i32 %11, i32* %3
%12 = load i8*, i8** %2
%13 = call i8* @get_string(i8* %12)
store i8* %13, i8** %5
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = icmp eq i32 %15, 111
br i1 %16, label %17, label %20
17: ; preds = %1
store i32 1, i32* %6
%18 = load i8*, i8** %5
%19 = getelementptr inbounds i8, i8* %18, i32 1
store i8* %19, i8** %5
br label %21
20: ; preds = %1
store i32 0, i32* %6
br label %21
21: ; preds = %20, %17
%22 = load i8*, i8** %5
%23 = load i8, i8* %22
%24 = sext i8 %23 to i32
switch i32 %24, label %103 [
i32 101, label %25
i32 105, label %64
]
25: ; preds = %21
%26 = load i8*, i8** %5
%27 = getelementptr inbounds i8, i8* %26, i64 1
%28 = load i8, i8* %27
%29 = sext i8 %28 to i32
switch i32 %29, label %60 [
i32 118, label %30
i32 108, label %45
]
30: ; preds = %25
%31 = load i8*, i8** %5
%32 = getelementptr inbounds i8, i8* %31, i64 2
%33 = load i8, i8* %32
%34 = sext i8 %33 to i32
switch i32 %34, label %41 [
i32 108, label %35
i32 0, label %38
]
35: ; preds = %30
%36 = load i32, i32* %6
%37 = add nsw i32 %36, 4
store i32 %37, i32* %6
br label %44
38: ; preds = %30
%39 = load i32, i32* %6
%40 = add nsw i32 %39, 1
store i32 %40, i32* %6
br label %44
41: ; preds = %30
%42 = load i8*, i8** %2
%43 = call i32 @halt(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* %42)
br label %44
44: ; preds = %41, %38, %35
br label %63
45: ; preds = %25
%46 = load i8*, i8** %5
%47 = getelementptr inbounds i8, i8* %46, i64 2
%48 = load i8, i8* %47
%49 = sext i8 %48 to i32
switch i32 %49, label %56 [
i32 108, label %50
i32 0, label %53
]
50: ; preds = %45
%51 = load i32, i32* %6
%52 = add nsw i32 %51, 16
store i32 %52, i32* %6
br label %59
53: ; preds = %45
%54 = load i32, i32* %6
%55 = add nsw i32 %54, 8
store i32 %55, i32* %6
br label %59
56: ; preds = %45
%57 = load i8*, i8** %2
%58 = call i32 @halt(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* %57)
br label %59
59: ; preds = %56, %53, %50
br label %63
60: ; preds = %25
%61 = load i8*, i8** %2
%62 = call i32 @halt(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* %61)
br label %63
63: ; preds = %60, %59, %44
br label %106
64: ; preds = %21
%65 = load i8*, i8** %5
%66 = getelementptr inbounds i8, i8* %65, i64 1
%67 = load i8, i8* %66
%68 = sext i8 %67 to i32
switch i32 %68, label %99 [
i32 118, label %69
i32 108, label %84
]
69: ; preds = %64
%70 = load i8*, i8** %5
%71 = getelementptr inbounds i8, i8* %70, i64 2
%72 = load i8, i8* %71
%73 = sext i8 %72 to i32
switch i32 %73, label %80 [
i32 108, label %74
i32 0, label %77
]
74: ; preds = %69
%75 = load i32, i32* %6
%76 = add nsw i32 %75, 64
store i32 %76, i32* %6
br label %83
77: ; preds = %69
%78 = load i32, i32* %6
%79 = add nsw i32 %78, 32
store i32 %79, i32* %6
br label %83
80: ; preds = %69
%81 = load i8*, i8** %2
%82 = call i32 @halt(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* %81)
br label %83
83: ; preds = %80, %77, %74
br label %102
84: ; preds = %64
%85 = load i8*, i8** %5
%86 = getelementptr inbounds i8, i8* %85, i64 2
%87 = load i8, i8* %86
%88 = sext i8 %87 to i32
switch i32 %88, label %95 [
i32 108, label %89
i32 0, label %92
]
89: ; preds = %84
%90 = load i32, i32* %6
%91 = add nsw i32 %90, 256
store i32 %91, i32* %6
br label %98
92: ; preds = %84
%93 = load i32, i32* %6
%94 = add nsw i32 %93, 128
store i32 %94, i32* %6
br label %98
95: ; preds = %84
%96 = load i8*, i8** %2
%97 = call i32 @halt(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* %96)
br label %98
98: ; preds = %95, %92, %89
br label %102
99: ; preds = %64
%100 = load i8*, i8** %2
%101 = call i32 @halt(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* %100)
br label %102
102: ; preds = %99, %98, %83
br label %106
103: ; preds = %21
%104 = load i8*, i8** %2
%105 = call i32 @halt(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* %104)
br label %106
106: ; preds = %103, %102, %63
%107 = load i8*, i8** %2
%108 = load i32, i32* %3
%109 = load i64, i64* %4
%110 = load i32, i32* %6
%111 = call i64 @tt_getCoords(i8* %107, i32 10240, i32 %108, i64 %109, i32 %110)
%112 = icmp slt i64 %111, 0
br i1 %112, label %113, label %115
113: ; preds = %106
%114 = load i8*, i8** %2
store i8 0, i8* %114
br label %115
115: ; preds = %113, %106
%116 = load i8*, i8** %2
ret i8* %116
}

LLVM IR (-O2):
@.str = [12 x i8] c"ttGetCoords\00"
@.str.1 = [17 x i8] c"Unexpected '%s'.\00"
define i8* @macttGetCoords(i8* returned %0) {
%2 = tail call i64 @get_num(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i64 @get_num(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = trunc i64 %3 to i32
%5 = tail call i8* @get_string(i8* %0)
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 111
%8 = zext i1 %7 to i64
%9 = getelementptr i8, i8* %5, i64 %8
%10 = zext i1 %7 to i32
%11 = load i8, i8* %9
%12 = sext i8 %11 to i32
switch i32 %12, label %65 [
i32 101, label %13
i32 105, label %39
]
13: ; preds = %1
%14 = getelementptr inbounds i8, i8* %9, i64 1
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
switch i32 %16, label %37 [
i32 118, label %17
i32 108, label %27
]
17: ; preds = %13
%18 = getelementptr inbounds i8, i8* %9, i64 2
%19 = load i8, i8* %18
%20 = sext i8 %19 to i32
switch i32 %20, label %25 [
i32 108, label %21
i32 0, label %23
]
21: ; preds = %17
%22 = or i32 %10, 4
br label %67
23: ; preds = %17
%24 = select i1 %7, i32 2, i32 1
br label %67
25: ; preds = %17
%26 = tail call i32 @halt(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* %0)
br label %67
27: ; preds = %13
%28 = getelementptr inbounds i8, i8* %9, i64 2
%29 = load i8, i8* %28
%30 = sext i8 %29 to i32
switch i32 %30, label %35 [
i32 108, label %31
i32 0, label %33
]
31: ; preds = %27
%32 = or i32 %10, 16
br label %67
33: ; preds = %27
%34 = or i32 %10, 8
br label %67
35: ; preds = %27
%36 = tail call i32 @halt(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* %0)
br label %67
37: ; preds = %13
%38 = tail call i32 @halt(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* %0)
br label %67
39: ; preds = %1
%40 = getelementptr inbounds i8, i8* %9, i64 1
%41 = load i8, i8* %40
%42 = sext i8 %41 to i32
switch i32 %42, label %63 [
i32 118, label %43
i32 108, label %53
]
43: ; preds = %39
%44 = getelementptr inbounds i8, i8* %9, i64 2
%45 = load i8, i8* %44
%46 = sext i8 %45 to i32
switch i32 %46, label %51 [
i32 108, label %47
i32 0, label %49
]
47: ; preds = %43
%48 = or i32 %10, 64
br label %67
49: ; preds = %43
%50 = or i32 %10, 32
br label %67
51: ; preds = %43
%52 = tail call i32 @halt(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* %0)
br label %67
53: ; preds = %39
%54 = getelementptr inbounds i8, i8* %9, i64 2
%55 = load i8, i8* %54
%56 = sext i8 %55 to i32
switch i32 %56, label %61 [
i32 108, label %57
i32 0, label %59
]
57: ; preds = %53
%58 = or i32 %10, 256
br label %67
59: ; preds = %53
%60 = or i32 %10, 128
br label %67
61: ; preds = %53
%62 = tail call i32 @halt(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* %0)
br label %67
63: ; preds = %39
%64 = tail call i32 @halt(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* %0)
br label %67
65: ; preds = %1
%66 = tail call i32 @halt(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* %0)
br label %67
67: ; preds = %63, %51, %49, %47, %61, %59, %57, %37, %25, %23, %21, %35, %33, %31, %65
%68 = phi i32 [ %10, %65 ], [ %10, %63 ], [ %10, %61 ], [ %60, %59 ], [ %58, %57 ], [ %10, %51 ], [ %50, %49 ], [ %48, %47 ], [ %10, %37 ], [ %10, %35 ], [ %34, %33 ], [ %32, %31 ], [ %10, %25 ], [ %24, %23 ], [ %22, %21 ]
%69 = tail call i64 @tt_getCoords(i8* %0, i32 10240, i32 %4, i64 %2, i32 %68)
%70 = icmp slt i64 %69, 0
br i1 %70, label %71, label %72
71: ; preds = %67
store i8 0, i8* %0
br label %72
72: ; preds = %71, %67
ret i8* %0
}