#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 */
scalar_t__ isupper(unsigned char);
char tolower(unsigned char);
void eatsize(const char **p) {
  const char *l = *p;
  if ((isupper((unsigned char)(*l)) ? tolower((unsigned char)(*l)) : (*l)) ==
      'u')
    l++;
  switch (
      (isupper((unsigned char)(*l)) ? tolower((unsigned char)(*l)) : (*l))) {
  case 'l':
  case 's':
  case 'h':
  case 'b':
  case 'c':
    l++;
  default:
    break;
  }
  *p = l;
}


x86 assembly (clang, -O0):
<eatsize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movzbl (%rax),%edi
call   1040 <isupper@plt>
cmp    $0x0,%rax
je     1164 <eatsize+0x44>
mov    -0x10(%rbp),%rax
movzbl (%rax),%edi
call   1030 <tolower@plt>
movsbl %al,%eax
mov    %eax,-0x14(%rbp)
jmp    116e <eatsize+0x4e>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    $0x75,%eax
jne    1186 <eatsize+0x66>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movzbl (%rax),%edi
call   1040 <isupper@plt>
cmp    $0x0,%rax
je     11b3 <eatsize+0x93>
mov    -0x10(%rbp),%rax
movzbl (%rax),%edi
call   1030 <tolower@plt>
movsbl %al,%eax
mov    %eax,-0x18(%rbp)
jmp    11bd <eatsize+0x9d>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x1c(%rbp)
add    $0xffffff9e,%eax
sub    $0x2,%eax
jb     1207 <eatsize+0xe7>
jmp    11d4 <eatsize+0xb4>
mov    -0x1c(%rbp),%eax
sub    $0x68,%eax
je     1207 <eatsize+0xe7>
jmp    11e5 <eatsize+0xc5>
mov    -0x1c(%rbp),%eax
sub    $0x6c,%eax
je     1207 <eatsize+0xe7>
jmp    11f6 <eatsize+0xd6>
mov    -0x1c(%rbp),%eax
sub    $0x73,%eax
jne    1213 <eatsize+0xf3>
jmp    1207 <eatsize+0xe7>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1218 <eatsize+0xf8>
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eatsize>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
mov    (%rdi),%r15
movzbl (%r15),%edi
call   1040 <isupper@plt>
mov    %rax,%rcx
mov    (%r15),%al
test   %rcx,%rcx
je     1147 <eatsize+0x27>
movzbl %al,%edi
call   1030 <tolower@plt>
xor    %ebx,%ebx
cmp    $0x75,%al
sete   %bl
movzbl (%r15,%rbx,1),%edi
call   1040 <isupper@plt>
mov    %rax,%rcx
mov    (%r15,%rbx,1),%al
test   %rcx,%rcx
je     116c <eatsize+0x4c>
movzbl %al,%edi
call   1030 <tolower@plt>
add    %rbx,%r15
movsbl %al,%eax
add    $0xffffff9e,%eax
cmp    $0x11,%eax
ja     1188 <eatsize+0x68>
mov    $0x20443,%ecx
bt     %eax,%ecx
jae    1188 <eatsize+0x68>
add    $0x1,%r15
mov    %r15,(%r14)
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @eatsize(i8** %0) {
%2 = alloca i8**
%3 = alloca i8*
store i8** %0, i8*** %2
%4 = load i8**, i8*** %2
%5 = load i8*, i8** %4
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = call i64 @isupper(i8 zeroext %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %15
10: ; preds = %1
%11 = load i8*, i8** %3
%12 = load i8, i8* %11
%13 = call signext i8 @tolower(i8 zeroext %12)
%14 = sext i8 %13 to i32
br label %19
15: ; preds = %1
%16 = load i8*, i8** %3
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
br label %19
19: ; preds = %15, %10
%20 = phi i32 [ %14, %10 ], [ %18, %15 ]
%21 = icmp eq i32 %20, 117
br i1 %21, label %22, label %25
22: ; preds = %19
%23 = load i8*, i8** %3
%24 = getelementptr inbounds i8, i8* %23, i32 1
store i8* %24, i8** %3
br label %25
25: ; preds = %22, %19
%26 = load i8*, i8** %3
%27 = load i8, i8* %26
%28 = call i64 @isupper(i8 zeroext %27)
%29 = icmp ne i64 %28, 0
br i1 %29, label %30, label %35
30: ; preds = %25
%31 = load i8*, i8** %3
%32 = load i8, i8* %31
%33 = call signext i8 @tolower(i8 zeroext %32)
%34 = sext i8 %33 to i32
br label %39
35: ; preds = %25
%36 = load i8*, i8** %3
%37 = load i8, i8* %36
%38 = sext i8 %37 to i32
br label %39
39: ; preds = %35, %30
%40 = phi i32 [ %34, %30 ], [ %38, %35 ]
switch i32 %40, label %44 [
i32 108, label %41
i32 115, label %41
i32 104, label %41
i32 98, label %41
i32 99, label %41
]
41: ; preds = %39, %39, %39, %39, %39
%42 = load i8*, i8** %3
%43 = getelementptr inbounds i8, i8* %42, i32 1
store i8* %43, i8** %3
br label %44
44: ; preds = %39, %41
br label %45
45: ; preds = %44
%46 = load i8*, i8** %3
%47 = load i8**, i8*** %2
store i8* %46, i8** %47
ret void
}

LLVM IR (-O2):
define void @eatsize(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = load i8, i8* %2
%4 = tail call i64 @isupper(i8 zeroext %3)
%5 = icmp eq i64 %4, 0
%6 = load i8, i8* %2
br i1 %5, label %9, label %7
7: ; preds = %1
%8 = tail call signext i8 @tolower(i8 zeroext %6)
br label %9
9: ; preds = %1, %7
%10 = phi i8 [ %8, %7 ], [ %6, %1 ]
%11 = icmp eq i8 %10, 117
%12 = zext i1 %11 to i64
%13 = getelementptr i8, i8* %2, i64 %12
%14 = load i8, i8* %13
%15 = tail call i64 @isupper(i8 zeroext %14)
%16 = icmp eq i64 %15, 0
%17 = load i8, i8* %13
br i1 %16, label %20, label %18
18: ; preds = %9
%19 = tail call signext i8 @tolower(i8 zeroext %17)
br label %20
20: ; preds = %9, %18
%21 = phi i8 [ %19, %18 ], [ %17, %9 ]
%22 = sext i8 %21 to i32
switch i32 %22, label %25 [
i32 108, label %23
i32 115, label %23
i32 104, label %23
i32 98, label %23
i32 99, label %23
]
23: ; preds = %20, %20, %20, %20, %20
%24 = getelementptr inbounds i8, i8* %13, i64 1
br label %25
25: ; preds = %23, %20
%26 = phi i8* [ %13, %20 ], [ %24, %23 ]
store i8* %26, i8** %0
ret void
}