#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 Getc();
int get_new_len(int c) {
  int len;
  if (c < 192)
    len = c;
  else if (c < 224)
    len = ((c - 192) << 8) + Getc() + 192;
  else if (c == 255) {
    len = (Getc() << 24);
    len |= (Getc() << 16);
    len |= (Getc() << 8);
    len |= Getc();
  } else
    len = 1 << (c & 0x1f);
  return len;
}


x86 assembly (clang, -O0):
<get_new_len>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0xc0,-0x4(%rbp)
jge    1133 <get_new_len+0x23>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    11cf <get_new_len+0xbf>
cmpl   $0xe0,-0x4(%rbp)
jge    1169 <get_new_len+0x59>
mov    -0x4(%rbp),%eax
sub    $0xc0,%eax
shl    $0x8,%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <Getc@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
add    $0xc0,%eax
mov    %eax,-0x8(%rbp)
jmp    11ca <get_new_len+0xba>
cmpl   $0xff,-0x4(%rbp)
jne    11b5 <get_new_len+0xa5>
mov    $0x0,%al
call   1030 <Getc@plt>
shl    $0x18,%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <Getc@plt>
shl    $0x10,%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <Getc@plt>
shl    $0x8,%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <Getc@plt>
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    11c5 <get_new_len+0xb5>
mov    -0x4(%rbp),%ecx
and    $0x1f,%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,-0x8(%rbp)
jmp    11ca <get_new_len+0xba>
jmp    11cf <get_new_len+0xbf>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_new_len>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%ebx
cmp    $0xc0,%edi
jl     1185 <get_new_len+0x75>
cmp    $0xdf,%ebx
ja     113a <get_new_len+0x2a>
shl    $0x8,%ebx
xor    %eax,%eax
call   1030 <Getc@plt>
add    %eax,%ebx
add    $0xffff40c0,%ebx
jmp    1185 <get_new_len+0x75>
cmp    $0xff,%ebx
jne    117a <get_new_len+0x6a>
xor    %eax,%eax
call   1030 <Getc@plt>
mov    %eax,%ebx
shl    $0x18,%ebx
xor    %eax,%eax
call   1030 <Getc@plt>
mov    %eax,%ebp
shl    $0x10,%ebp
or     %ebx,%ebp
xor    %eax,%eax
call   1030 <Getc@plt>
mov    %eax,%r14d
shl    $0x8,%r14d
xor    %eax,%eax
call   1030 <Getc@plt>
mov    %eax,%ebx
or     %r14d,%ebx
or     %ebp,%ebx
jmp    1185 <get_new_len+0x75>
mov    $0x1,%eax
mov    %ebx,%ecx
shl    %cl,%eax
mov    %eax,%ebx
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @get_new_len(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 192
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = load i32, i32* %2
store i32 %7, i32* %3
br label %41
8: ; preds = %1
%9 = load i32, i32* %2
%10 = icmp slt i32 %9, 224
br i1 %10, label %11, label %18
11: ; preds = %8
%12 = load i32, i32* %2
%13 = sub nsw i32 %12, 192
%14 = shl i32 %13, 8
%15 = call i32 (...) @Getc()
%16 = add nsw i32 %14, %15
%17 = add nsw i32 %16, 192
store i32 %17, i32* %3
br label %40
18: ; preds = %8
%19 = load i32, i32* %2
%20 = icmp eq i32 %19, 255
br i1 %20, label %21, label %35
21: ; preds = %18
%22 = call i32 (...) @Getc()
%23 = shl i32 %22, 24
store i32 %23, i32* %3
%24 = call i32 (...) @Getc()
%25 = shl i32 %24, 16
%26 = load i32, i32* %3
%27 = or i32 %26, %25
store i32 %27, i32* %3
%28 = call i32 (...) @Getc()
%29 = shl i32 %28, 8
%30 = load i32, i32* %3
%31 = or i32 %30, %29
store i32 %31, i32* %3
%32 = call i32 (...) @Getc()
%33 = load i32, i32* %3
%34 = or i32 %33, %32
store i32 %34, i32* %3
br label %39
35: ; preds = %18
%36 = load i32, i32* %2
%37 = and i32 %36, 31
%38 = shl i32 1, %37
store i32 %38, i32* %3
br label %39
39: ; preds = %35, %21
br label %40
40: ; preds = %39, %11
br label %41
41: ; preds = %40, %6
%42 = load i32, i32* %3
ret i32 %42
}

LLVM IR (-O2):
define i32 @get_new_len(i32 %0) {
%2 = icmp slt i32 %0, 192
br i1 %2, label %26, label %3
3: ; preds = %1
%4 = icmp ult i32 %0, 224
br i1 %4, label %5, label %10
5: ; preds = %3
%6 = shl nuw nsw i32 %0, 8
%7 = tail call i32 (...) @Getc()
%8 = add nsw i32 %6, -48960
%9 = add i32 %8, %7
br label %26
10: ; preds = %3
%11 = icmp eq i32 %0, 255
br i1 %11, label %12, label %23
12: ; preds = %10
%13 = tail call i32 (...) @Getc()
%14 = shl i32 %13, 24
%15 = tail call i32 (...) @Getc()
%16 = shl i32 %15, 16
%17 = or i32 %16, %14
%18 = tail call i32 (...) @Getc()
%19 = shl i32 %18, 8
%20 = or i32 %17, %19
%21 = tail call i32 (...) @Getc()
%22 = or i32 %20, %21
br label %26
23: ; preds = %10
%24 = and i32 %0, 31
%25 = shl nuw i32 1, %24
br label %26
26: ; preds = %1, %5, %23, %12
%27 = phi i32 [ %9, %5 ], [ %22, %12 ], [ %25, %23 ], [ %0, %1 ]
ret i32 %27
}