#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 sscanf(char *, char *, int *);
int /*<<< orphan*/ strcmp(char *, char *);
int strlen(char *);
int get_marker_number(char *name) {
  int id;
  switch (name[0]) {
  case 'A':
    if ((strlen(name) == 4 || strlen(name) == 5) &&
        sscanf(name, "APP%d", &id) == 1)
      return id + (0xE0);
    break;
  case 'C':
    if (0 == strcmp(name, "COM"))
      return (0xFE);
    break;
  case 'D':
    if (0 == strcmp(name, "DHT"))
      return (0xC4);
    if (0 == strcmp(name, "DAC"))
      return (0xCC);
    if (0 == strcmp(name, "DQT"))
      return (0xDB);
    if (0 == strcmp(name, "DNL"))
      return (0xDC);
    if (0 == strcmp(name, "DRI"))
      return (0xDD);
    if (0 == strcmp(name, "DHP"))
      return (0xDE);
    break;
  case 'E':
    if (0 == strcmp(name, "EOI"))
      return (0xD9);
    if (0 == strcmp(name, "EXP"))
      return (0xDF);
    break;
  case 'J':
    if (0 == strcmp(name, "JPG"))
      return (0xC8);
    if ((strlen(name) == 4 || strlen(name) == 5) &&
        sscanf(name, "JPG%d", &id) == 1)
      return id + (0xF0);
    break;
  case 'R':
    if (strlen(name) == 6 && sscanf(name, "RES_%x", &id) == 1)
      return id;
    if (strlen(name) == 4 && sscanf(name, "RST%d", &id) == 1)
      return id + (0xD0);
    break;
  case 'S':
    if (0 == strcmp(name, "SOI"))
      return (0xD8);
    if (0 == strcmp(name, "SOS"))
      return (0xDA);
    if ((strlen(name) == 4 || strlen(name) == 5) &&
        sscanf(name, "SOF%d", &id) == 1)
      return id + (0xC0);
    break;
  case 'T':
    if (0 == strcmp(name, "TEM"))
      return (0x01);
    break;
  default:
    return -1;
    break;
  }
  return -1;
}


x86 assembly (clang, -O0):
<get_marker_number>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
add    $0xffffffbf,%eax
mov    %eax,%ecx
mov    %rcx,-0x20(%rbp)
sub    $0x13,%eax
ja     1505 <get_marker_number+0x3d5>
mov    -0x20(%rbp),%rax
lea    0xea0(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x4,%eax
je     118d <get_marker_number+0x5d>
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x5,%eax
jne    11ba <get_marker_number+0x8a>
mov    -0x10(%rbp),%rdi
lea    0xeb8(%rip),%rsi
lea    -0x14(%rbp),%rdx
call   1050 <sscanf@plt>
cmp    $0x1,%eax
jne    11ba <get_marker_number+0x8a>
mov    -0x14(%rbp),%eax
add    $0xe0,%eax
mov    %eax,-0x4(%rbp)
jmp    1518 <get_marker_number+0x3e8>
jmp    1511 <get_marker_number+0x3e1>
mov    -0x10(%rbp),%rdi
lea    0xe8c(%rip),%rsi
call   1040 <strcmp@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    %ecx,%eax
jne    11e7 <get_marker_number+0xb7>
movl   $0xfe,-0x4(%rbp)
jmp    1518 <get_marker_number+0x3e8>
jmp    1511 <get_marker_number+0x3e1>
mov    -0x10(%rbp),%rdi
lea    0xe63(%rip),%rsi
call   1040 <strcmp@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    %ecx,%eax
jne    1214 <get_marker_number+0xe4>
movl   $0xc4,-0x4(%rbp)
jmp    1518 <get_marker_number+0x3e8>
mov    -0x10(%rbp),%rdi
lea    0xe3f(%rip),%rsi
call   1040 <strcmp@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    %ecx,%eax
jne    123c <get_marker_number+0x10c>
movl   $0xcc,-0x4(%rbp)
jmp    1518 <get_marker_number+0x3e8>
mov    -0x10(%rbp),%rdi
lea    0xe1b(%rip),%rsi
call   1040 <strcmp@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    %ecx,%eax
jne    1264 <get_marker_number+0x134>
movl   $0xdb,-0x4(%rbp)
jmp    1518 <get_marker_number+0x3e8>
mov    -0x10(%rbp),%rdi
lea    0xdf7(%rip),%rsi
call   1040 <strcmp@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    %ecx,%eax
jne    128c <get_marker_number+0x15c>
movl   $0xdc,-0x4(%rbp)
jmp    1518 <get_marker_number+0x3e8>
mov    -0x10(%rbp),%rdi
lea    0xdd3(%rip),%rsi
call   1040 <strcmp@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    %ecx,%eax
jne    12b4 <get_marker_number+0x184>
movl   $0xdd,-0x4(%rbp)
jmp    1518 <get_marker_number+0x3e8>
mov    -0x10(%rbp),%rdi
lea    0xdaf(%rip),%rsi
call   1040 <strcmp@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    %ecx,%eax
jne    12dc <get_marker_number+0x1ac>
movl   $0xde,-0x4(%rbp)
jmp    1518 <get_marker_number+0x3e8>
jmp    1511 <get_marker_number+0x3e1>
mov    -0x10(%rbp),%rdi
lea    0xd86(%rip),%rsi
call   1040 <strcmp@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    %ecx,%eax
jne    1309 <get_marker_number+0x1d9>
movl   $0xd9,-0x4(%rbp)
jmp    1518 <get_marker_number+0x3e8>
mov    -0x10(%rbp),%rdi
lea    0xd62(%rip),%rsi
call   1040 <strcmp@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    %ecx,%eax
jne    1331 <get_marker_number+0x201>
movl   $0xdf,-0x4(%rbp)
jmp    1518 <get_marker_number+0x3e8>
jmp    1511 <get_marker_number+0x3e1>
mov    -0x10(%rbp),%rdi
lea    0xd39(%rip),%rsi
call   1040 <strcmp@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    %ecx,%eax
jne    135e <get_marker_number+0x22e>
movl   $0xc8,-0x4(%rbp)
jmp    1518 <get_marker_number+0x3e8>
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x4,%eax
je     1382 <get_marker_number+0x252>
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x5,%eax
jne    13af <get_marker_number+0x27f>
mov    -0x10(%rbp),%rdi
lea    0xcf1(%rip),%rsi
lea    -0x14(%rbp),%rdx
call   1050 <sscanf@plt>
cmp    $0x1,%eax
jne    13af <get_marker_number+0x27f>
mov    -0x14(%rbp),%eax
add    $0xf0,%eax
mov    %eax,-0x4(%rbp)
jmp    1518 <get_marker_number+0x3e8>
jmp    1511 <get_marker_number+0x3e1>
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x6,%eax
jne    13ee <get_marker_number+0x2be>
mov    -0x10(%rbp),%rdi
lea    0xcb3(%rip),%rsi
lea    -0x14(%rbp),%rdx
call   1050 <sscanf@plt>
cmp    $0x1,%eax
jne    13ee <get_marker_number+0x2be>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1518 <get_marker_number+0x3e8>
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x4,%eax
jne    142d <get_marker_number+0x2fd>
mov    -0x10(%rbp),%rdi
lea    0xc80(%rip),%rsi
lea    -0x14(%rbp),%rdx
call   1050 <sscanf@plt>
cmp    $0x1,%eax
jne    142d <get_marker_number+0x2fd>
mov    -0x14(%rbp),%eax
add    $0xd0,%eax
mov    %eax,-0x4(%rbp)
jmp    1518 <get_marker_number+0x3e8>
jmp    1511 <get_marker_number+0x3e1>
mov    -0x10(%rbp),%rdi
lea    0xc54(%rip),%rsi
call   1040 <strcmp@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    %ecx,%eax
jne    145a <get_marker_number+0x32a>
movl   $0xd8,-0x4(%rbp)
jmp    1518 <get_marker_number+0x3e8>
mov    -0x10(%rbp),%rdi
lea    0xc30(%rip),%rsi
call   1040 <strcmp@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    %ecx,%eax
jne    1482 <get_marker_number+0x352>
movl   $0xda,-0x4(%rbp)
jmp    1518 <get_marker_number+0x3e8>
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x4,%eax
je     14a6 <get_marker_number+0x376>
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x5,%eax
jne    14d3 <get_marker_number+0x3a3>
mov    -0x10(%rbp),%rdi
lea    0xbe8(%rip),%rsi
lea    -0x14(%rbp),%rdx
call   1050 <sscanf@plt>
cmp    $0x1,%eax
jne    14d3 <get_marker_number+0x3a3>
mov    -0x14(%rbp),%eax
add    $0xc0,%eax
mov    %eax,-0x4(%rbp)
jmp    1518 <get_marker_number+0x3e8>
jmp    1511 <get_marker_number+0x3e1>
mov    -0x10(%rbp),%rdi
lea    0xbbc(%rip),%rsi
call   1040 <strcmp@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    %ecx,%eax
jne    1500 <get_marker_number+0x3d0>
movl   $0x1,-0x4(%rbp)
jmp    1518 <get_marker_number+0x3e8>
jmp    1511 <get_marker_number+0x3e1>
movl   $0xffffffff,-0x4(%rbp)
jmp    1518 <get_marker_number+0x3e8>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_marker_number>:
push   %rbp
push   %rbx
push   %rax
movsbl (%rdi),%eax
mov    $0xffffffff,%ebp
add    $0xffffffbf,%eax
cmp    $0x13,%eax
ja     1426 <get_marker_number+0x2f6>
mov    %rdi,%rbx
lea    0xeaf(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    %rbx,%rdi
call   1030 <strlen@plt>
cmp    $0x4,%eax
je     1178 <get_marker_number+0x48>
mov    %rbx,%rdi
call   1030 <strlen@plt>
cmp    $0x5,%eax
jne    1426 <get_marker_number+0x2f6>
lea    0xed1(%rip),%rsi
lea    0x4(%rsp),%rdx
mov    %rbx,%rdi
call   1050 <sscanf@plt>
cmp    $0x1,%eax
jne    1426 <get_marker_number+0x2f6>
mov    $0xe0,%ebp
add    0x4(%rsp),%ebp
jmp    1426 <get_marker_number+0x2f6>
lea    0xeac(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
jne    1426 <get_marker_number+0x2f6>
mov    $0xfe,%ebp
jmp    1426 <get_marker_number+0x2f6>
lea    0xe8f(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
je     13e9 <get_marker_number+0x2b9>
lea    0xe7c(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
je     1405 <get_marker_number+0x2d5>
lea    0xe69(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
je     1413 <get_marker_number+0x2e3>
lea    0xe56(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
je     141a <get_marker_number+0x2ea>
lea    0xe43(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
je     1421 <get_marker_number+0x2f1>
lea    0xe30(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
jne    1426 <get_marker_number+0x2f6>
mov    $0xde,%ebp
jmp    1426 <get_marker_number+0x2f6>
lea    0xe13(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
je     13f0 <get_marker_number+0x2c0>
lea    0xe00(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
jne    1426 <get_marker_number+0x2f6>
mov    $0xdf,%ebp
jmp    1426 <get_marker_number+0x2f6>
lea    0xde3(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
je     13f7 <get_marker_number+0x2c7>
mov    %rbx,%rdi
call   1030 <strlen@plt>
cmp    $0x4,%eax
je     12c5 <get_marker_number+0x195>
mov    %rbx,%rdi
call   1030 <strlen@plt>
cmp    $0x5,%eax
jne    1426 <get_marker_number+0x2f6>
lea    0xdb2(%rip),%rsi
lea    0x4(%rsp),%rdx
mov    %rbx,%rdi
call   1050 <sscanf@plt>
cmp    $0x1,%eax
jne    1426 <get_marker_number+0x2f6>
mov    $0xf0,%ebp
add    0x4(%rsp),%ebp
jmp    1426 <get_marker_number+0x2f6>
mov    %rbx,%rdi
call   1030 <strlen@plt>
cmp    $0x6,%eax
jne    13b8 <get_marker_number+0x288>
lea    0xd7c(%rip),%rsi
lea    0x4(%rsp),%rdx
mov    %rbx,%rdi
call   1050 <sscanf@plt>
cmp    $0x1,%eax
jne    13b8 <get_marker_number+0x288>
mov    0x4(%rsp),%ebp
jmp    1426 <get_marker_number+0x2f6>
lea    0xd63(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
je     13fe <get_marker_number+0x2ce>
lea    0xd50(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
je     140c <get_marker_number+0x2dc>
mov    %rbx,%rdi
call   1030 <strlen@plt>
cmp    $0x4,%eax
je     1373 <get_marker_number+0x243>
mov    %rbx,%rdi
call   1030 <strlen@plt>
cmp    $0x5,%eax
jne    1426 <get_marker_number+0x2f6>
lea    0xd1f(%rip),%rsi
lea    0x4(%rsp),%rdx
mov    %rbx,%rdi
call   1050 <sscanf@plt>
cmp    $0x1,%eax
jne    1426 <get_marker_number+0x2f6>
mov    $0xc0,%ebp
add    0x4(%rsp),%ebp
jmp    1426 <get_marker_number+0x2f6>
lea    0xcfa(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
jne    1426 <get_marker_number+0x2f6>
mov    $0x1,%ebp
jmp    1426 <get_marker_number+0x2f6>
mov    %rbx,%rdi
call   1030 <strlen@plt>
cmp    $0x4,%eax
jne    1426 <get_marker_number+0x2f6>
lea    0xcbf(%rip),%rsi
lea    0x4(%rsp),%rdx
mov    %rbx,%rdi
call   1050 <sscanf@plt>
cmp    $0x1,%eax
jne    1426 <get_marker_number+0x2f6>
mov    $0xd0,%ebp
add    0x4(%rsp),%ebp
jmp    1426 <get_marker_number+0x2f6>
mov    $0xc4,%ebp
jmp    1426 <get_marker_number+0x2f6>
mov    $0xd9,%ebp
jmp    1426 <get_marker_number+0x2f6>
mov    $0xc8,%ebp
jmp    1426 <get_marker_number+0x2f6>
mov    $0xd8,%ebp
jmp    1426 <get_marker_number+0x2f6>
mov    $0xcc,%ebp
jmp    1426 <get_marker_number+0x2f6>
mov    $0xda,%ebp
jmp    1426 <get_marker_number+0x2f6>
mov    $0xdb,%ebp
jmp    1426 <get_marker_number+0x2f6>
mov    $0xdc,%ebp
jmp    1426 <get_marker_number+0x2f6>
mov    $0xdd,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [6 x i8] c"APP%d\00"
@.str.1 = [4 x i8] c"COM\00"
@.str.2 = [4 x i8] c"DHT\00"
@.str.3 = [4 x i8] c"DAC\00"
@.str.4 = [4 x i8] c"DQT\00"
@.str.5 = [4 x i8] c"DNL\00"
@.str.6 = [4 x i8] c"DRI\00"
@.str.7 = [4 x i8] c"DHP\00"
@.str.8 = [4 x i8] c"EOI\00"
@.str.9 = [4 x i8] c"EXP\00"
@.str.10 = [4 x i8] c"JPG\00"
@.str.11 = [6 x i8] c"JPG%d\00"
@.str.12 = [7 x i8] c"RES_%x\00"
@.str.13 = [6 x i8] c"RST%d\00"
@.str.14 = [4 x i8] c"SOI\00"
@.str.15 = [4 x i8] c"SOS\00"
@.str.16 = [6 x i8] c"SOF%d\00"
@.str.17 = [4 x i8] c"TEM\00"
define i32 @get_marker_number(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = getelementptr inbounds i8, i8* %5, i64 0
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
switch i32 %8, label %148 [
i32 65, label %9
i32 67, label %25
i32 68, label %31
i32 69, label %62
i32 74, label %73
i32 82, label %94
i32 83, label %116
i32 84, label %142
]
9: ; preds = %1
%10 = load i8*, i8** %3
%11 = call i32 @strlen(i8* %10)
%12 = icmp eq i32 %11, 4
br i1 %12, label %17, label %13
13: ; preds = %9
%14 = load i8*, i8** %3
%15 = call i32 @strlen(i8* %14)
%16 = icmp eq i32 %15, 5
br i1 %16, label %17, label %24
17: ; preds = %13, %9
%18 = load i8*, i8** %3
%19 = call i32 @sscanf(i8* %18, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %4)
%20 = icmp eq i32 %19, 1
br i1 %20, label %21, label %24
21: ; preds = %17
%22 = load i32, i32* %4
%23 = add nsw i32 %22, 224
store i32 %23, i32* %2
br label %150
24: ; preds = %17, %13
br label %149
25: ; preds = %1
%26 = load i8*, i8** %3
%27 = call i32 @strcmp(i8* %26, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%28 = icmp eq i32 0, %27
br i1 %28, label %29, label %30
29: ; preds = %25
store i32 254, i32* %2
br label %150
30: ; preds = %25
br label %149
31: ; preds = %1
%32 = load i8*, i8** %3
%33 = call i32 @strcmp(i8* %32, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%34 = icmp eq i32 0, %33
br i1 %34, label %35, label %36
35: ; preds = %31
store i32 196, i32* %2
br label %150
36: ; preds = %31
%37 = load i8*, i8** %3
%38 = call i32 @strcmp(i8* %37, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%39 = icmp eq i32 0, %38
br i1 %39, label %40, label %41
40: ; preds = %36
store i32 204, i32* %2
br label %150
41: ; preds = %36
%42 = load i8*, i8** %3
%43 = call i32 @strcmp(i8* %42, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%44 = icmp eq i32 0, %43
br i1 %44, label %45, label %46
45: ; preds = %41
store i32 219, i32* %2
br label %150
46: ; preds = %41
%47 = load i8*, i8** %3
%48 = call i32 @strcmp(i8* %47, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
%49 = icmp eq i32 0, %48
br i1 %49, label %50, label %51
50: ; preds = %46
store i32 220, i32* %2
br label %150
51: ; preds = %46
%52 = load i8*, i8** %3
%53 = call i32 @strcmp(i8* %52, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0))
%54 = icmp eq i32 0, %53
br i1 %54, label %55, label %56
55: ; preds = %51
store i32 221, i32* %2
br label %150
56: ; preds = %51
%57 = load i8*, i8** %3
%58 = call i32 @strcmp(i8* %57, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0))
%59 = icmp eq i32 0, %58
br i1 %59, label %60, label %61
60: ; preds = %56
store i32 222, i32* %2
br label %150
61: ; preds = %56
br label %149
62: ; preds = %1
%63 = load i8*, i8** %3
%64 = call i32 @strcmp(i8* %63, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0))
%65 = icmp eq i32 0, %64
br i1 %65, label %66, label %67
66: ; preds = %62
store i32 217, i32* %2
br label %150
67: ; preds = %62
%68 = load i8*, i8** %3
%69 = call i32 @strcmp(i8* %68, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0))
%70 = icmp eq i32 0, %69
br i1 %70, label %71, label %72
71: ; preds = %67
store i32 223, i32* %2
br label %150
72: ; preds = %67
br label %149
73: ; preds = %1
%74 = load i8*, i8** %3
%75 = call i32 @strcmp(i8* %74, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0))
%76 = icmp eq i32 0, %75
br i1 %76, label %77, label %78
77: ; preds = %73
store i32 200, i32* %2
br label %150
78: ; preds = %73
%79 = load i8*, i8** %3
%80 = call i32 @strlen(i8* %79)
%81 = icmp eq i32 %80, 4
br i1 %81, label %86, label %82
82: ; preds = %78
%83 = load i8*, i8** %3
%84 = call i32 @strlen(i8* %83)
%85 = icmp eq i32 %84, 5
br i1 %85, label %86, label %93
86: ; preds = %82, %78
%87 = load i8*, i8** %3
%88 = call i32 @sscanf(i8* %87, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.11, i64 0, i64 0), i32* %4)
%89 = icmp eq i32 %88, 1
br i1 %89, label %90, label %93
90: ; preds = %86
%91 = load i32, i32* %4
%92 = add nsw i32 %91, 240
store i32 %92, i32* %2
br label %150
93: ; preds = %86, %82
br label %149
94: ; preds = %1
%95 = load i8*, i8** %3
%96 = call i32 @strlen(i8* %95)
%97 = icmp eq i32 %96, 6
br i1 %97, label %98, label %104
98: ; preds = %94
%99 = load i8*, i8** %3
%100 = call i32 @sscanf(i8* %99, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.12, i64 0, i64 0), i32* %4)
%101 = icmp eq i32 %100, 1
br i1 %101, label %102, label %104
102: ; preds = %98
%103 = load i32, i32* %4
store i32 %103, i32* %2
br label %150
104: ; preds = %98, %94
%105 = load i8*, i8** %3
%106 = call i32 @strlen(i8* %105)
%107 = icmp eq i32 %106, 4
br i1 %107, label %108, label %115
108: ; preds = %104
%109 = load i8*, i8** %3
%110 = call i32 @sscanf(i8* %109, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.13, i64 0, i64 0), i32* %4)
%111 = icmp eq i32 %110, 1
br i1 %111, label %112, label %115
112: ; preds = %108
%113 = load i32, i32* %4
%114 = add nsw i32 %113, 208
store i32 %114, i32* %2
br label %150
115: ; preds = %108, %104
br label %149
116: ; preds = %1
%117 = load i8*, i8** %3
%118 = call i32 @strcmp(i8* %117, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.14, i64 0, i64 0))
%119 = icmp eq i32 0, %118
br i1 %119, label %120, label %121
120: ; preds = %116
store i32 216, i32* %2
br label %150
121: ; preds = %116
%122 = load i8*, i8** %3
%123 = call i32 @strcmp(i8* %122, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.15, i64 0, i64 0))
%124 = icmp eq i32 0, %123
br i1 %124, label %125, label %126
125: ; preds = %121
store i32 218, i32* %2
br label %150
126: ; preds = %121
%127 = load i8*, i8** %3
%128 = call i32 @strlen(i8* %127)
%129 = icmp eq i32 %128, 4
br i1 %129, label %134, label %130
130: ; preds = %126
%131 = load i8*, i8** %3
%132 = call i32 @strlen(i8* %131)
%133 = icmp eq i32 %132, 5
br i1 %133, label %134, label %141
134: ; preds = %130, %126
%135 = load i8*, i8** %3
%136 = call i32 @sscanf(i8* %135, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.16, i64 0, i64 0), i32* %4)
%137 = icmp eq i32 %136, 1
br i1 %137, label %138, label %141
138: ; preds = %134
%139 = load i32, i32* %4
%140 = add nsw i32 %139, 192
store i32 %140, i32* %2
br label %150
141: ; preds = %134, %130
br label %149
142: ; preds = %1
%143 = load i8*, i8** %3
%144 = call i32 @strcmp(i8* %143, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.17, i64 0, i64 0))
%145 = icmp eq i32 0, %144
br i1 %145, label %146, label %147
146: ; preds = %142
store i32 1, i32* %2
br label %150
147: ; preds = %142
br label %149
148: ; preds = %1
store i32 -1, i32* %2
br label %150
149: ; preds = %147, %141, %115, %93, %72, %61, %30, %24
store i32 -1, i32* %2
br label %150
150: ; preds = %149, %148, %146, %138, %125, %120, %112, %102, %90, %77, %71, %66, %60, %55, %50, %45, %40, %35, %29, %21
%151 = load i32, i32* %2
ret i32 %151
}

LLVM IR (-O2):
@.str = [6 x i8] c"APP%d\00"
@.str.1 = [4 x i8] c"COM\00"
@.str.2 = [4 x i8] c"DHT\00"
@.str.3 = [4 x i8] c"DAC\00"
@.str.4 = [4 x i8] c"DQT\00"
@.str.5 = [4 x i8] c"DNL\00"
@.str.6 = [4 x i8] c"DRI\00"
@.str.7 = [4 x i8] c"DHP\00"
@.str.8 = [4 x i8] c"EOI\00"
@.str.9 = [4 x i8] c"EXP\00"
@.str.10 = [4 x i8] c"JPG\00"
@.str.11 = [6 x i8] c"JPG%d\00"
@.str.12 = [7 x i8] c"RES_%x\00"
@.str.13 = [6 x i8] c"RST%d\00"
@.str.14 = [4 x i8] c"SOI\00"
@.str.15 = [4 x i8] c"SOS\00"
@.str.16 = [6 x i8] c"SOF%d\00"
@.str.17 = [4 x i8] c"TEM\00"
define i32 @get_marker_number(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = load i8, i8* %0
%5 = sext i8 %4 to i32
switch i32 %5, label %99 [
i32 65, label %6
i32 67, label %18
i32 68, label %21
i32 69, label %39
i32 74, label %45
i32 82, label %60
i32 83, label %77
i32 84, label %95
]
6: ; preds = %1
%7 = tail call i32 @strlen(i8* %0)
%8 = icmp eq i32 %7, 4
br i1 %8, label %12, label %9
9: ; preds = %6
%10 = tail call i32 @strlen(i8* %0)
%11 = icmp eq i32 %10, 5
br i1 %11, label %12, label %98
12: ; preds = %9, %6
%13 = call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %2)
%14 = icmp eq i32 %13, 1
br i1 %14, label %15, label %98
15: ; preds = %12
%16 = load i32, i32* %2
%17 = add nsw i32 %16, 224
br label %99
18: ; preds = %1
%19 = tail call i32 @strcmp(i8* %0, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%20 = icmp eq i32 %19, 0
br i1 %20, label %99, label %98
21: ; preds = %1
%22 = tail call i32 @strcmp(i8* %0, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%23 = icmp eq i32 %22, 0
br i1 %23, label %99, label %24
24: ; preds = %21
%25 = tail call i32 @strcmp(i8* %0, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%26 = icmp eq i32 %25, 0
br i1 %26, label %99, label %27
27: ; preds = %24
%28 = tail call i32 @strcmp(i8* %0, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%29 = icmp eq i32 %28, 0
br i1 %29, label %99, label %30
30: ; preds = %27
%31 = tail call i32 @strcmp(i8* %0, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
%32 = icmp eq i32 %31, 0
br i1 %32, label %99, label %33
33: ; preds = %30
%34 = tail call i32 @strcmp(i8* %0, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0))
%35 = icmp eq i32 %34, 0
br i1 %35, label %99, label %36
36: ; preds = %33
%37 = tail call i32 @strcmp(i8* %0, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0))
%38 = icmp eq i32 %37, 0
br i1 %38, label %99, label %98
39: ; preds = %1
%40 = tail call i32 @strcmp(i8* %0, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0))
%41 = icmp eq i32 %40, 0
br i1 %41, label %99, label %42
42: ; preds = %39
%43 = tail call i32 @strcmp(i8* %0, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0))
%44 = icmp eq i32 %43, 0
br i1 %44, label %99, label %98
45: ; preds = %1
%46 = tail call i32 @strcmp(i8* %0, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0))
%47 = icmp eq i32 %46, 0
br i1 %47, label %99, label %48
48: ; preds = %45
%49 = tail call i32 @strlen(i8* %0)
%50 = icmp eq i32 %49, 4
br i1 %50, label %54, label %51
51: ; preds = %48
%52 = tail call i32 @strlen(i8* %0)
%53 = icmp eq i32 %52, 5
br i1 %53, label %54, label %98
54: ; preds = %51, %48
%55 = call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.11, i64 0, i64 0), i32* %2)
%56 = icmp eq i32 %55, 1
br i1 %56, label %57, label %98
57: ; preds = %54
%58 = load i32, i32* %2
%59 = add nsw i32 %58, 240
br label %99
60: ; preds = %1
%61 = tail call i32 @strlen(i8* %0)
%62 = icmp eq i32 %61, 6
br i1 %62, label %63, label %68
63: ; preds = %60
%64 = call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.12, i64 0, i64 0), i32* %2)
%65 = icmp eq i32 %64, 1
br i1 %65, label %66, label %68
66: ; preds = %63
%67 = load i32, i32* %2
br label %99
68: ; preds = %63, %60
%69 = call i32 @strlen(i8* %0)
%70 = icmp eq i32 %69, 4
br i1 %70, label %71, label %98
71: ; preds = %68
%72 = call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.13, i64 0, i64 0), i32* %2)
%73 = icmp eq i32 %72, 1
br i1 %73, label %74, label %98
74: ; preds = %71
%75 = load i32, i32* %2
%76 = add nsw i32 %75, 208
br label %99
77: ; preds = %1
%78 = tail call i32 @strcmp(i8* %0, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.14, i64 0, i64 0))
%79 = icmp eq i32 %78, 0
br i1 %79, label %99, label %80
80: ; preds = %77
%81 = tail call i32 @strcmp(i8* %0, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.15, i64 0, i64 0))
%82 = icmp eq i32 %81, 0
br i1 %82, label %99, label %83
83: ; preds = %80
%84 = tail call i32 @strlen(i8* %0)
%85 = icmp eq i32 %84, 4
br i1 %85, label %89, label %86
86: ; preds = %83
%87 = tail call i32 @strlen(i8* %0)
%88 = icmp eq i32 %87, 5
br i1 %88, label %89, label %98
89: ; preds = %86, %83
%90 = call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.16, i64 0, i64 0), i32* %2)
%91 = icmp eq i32 %90, 1
br i1 %91, label %92, label %98
92: ; preds = %89
%93 = load i32, i32* %2
%94 = add nsw i32 %93, 192
br label %99
95: ; preds = %1
%96 = tail call i32 @strcmp(i8* %0, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.17, i64 0, i64 0))
%97 = icmp eq i32 %96, 0
br i1 %97, label %99, label %98
98: ; preds = %95, %86, %89, %68, %71, %51, %54, %42, %36, %18, %9, %12
br label %99
99: ; preds = %1, %95, %80, %77, %45, %42, %39, %36, %33, %30, %27, %24, %21, %18, %98, %92, %74, %66, %57, %15
%100 = phi i32 [ -1, %98 ], [ %94, %92 ], [ %67, %66 ], [ %76, %74 ], [ %59, %57 ], [ %17, %15 ], [ 254, %18 ], [ 196, %21 ], [ 204, %24 ], [ 219, %27 ], [ 220, %30 ], [ 221, %33 ], [ 222, %36 ], [ 217, %39 ], [ 223, %42 ], [ 200, %45 ], [ 216, %77 ], [ 218, %80 ], [ 1, %95 ], [ -1, %1 ]
ret i32 %100
}