#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 */
typedef int uint32_t;
struct output {
  int dummy;
};

/* Variables and functions */
int downcase_lithuanian_i(int, int, struct output *);
int /*<<< orphan*/ has_more_above(char const *, char const *);
int u_char_downcase(int);
bool downcase_lithuanian(uint32_t c, const char *q, const char *end,
                         struct output *output) {
  switch (c) {
  case ((uint32_t)0x0049):
  case ((uint32_t)0x004a):
  case ((uint32_t)0x012e):
    if (!has_more_above(q, end))
      return false;
    return downcase_lithuanian_i(u_char_downcase(c), '\0', output);
  case ((uint32_t)0x00cc):
    return downcase_lithuanian_i(((uint32_t)0x0069), ((uint32_t)0x0300),
                                 output);
  case ((uint32_t)0x00cd):
    return downcase_lithuanian_i(((uint32_t)0x0069), ((uint32_t)0x0301),
                                 output);
  case ((uint32_t)0x0128):
    return downcase_lithuanian_i(((uint32_t)0x0069), ((uint32_t)0x0303),
                                 output);
  default:
    return false;
  }
}


x86 assembly (clang, -O0):
<downcase_lithuanian>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x24(%rbp)
add    $0xffffffb7,%eax
sub    $0x2,%eax
jb     11aa <downcase_lithuanian+0x7a>
jmp    115e <downcase_lithuanian+0x2e>
mov    -0x24(%rbp),%eax
sub    $0xcc,%eax
je     11e9 <downcase_lithuanian+0xb9>
jmp    1171 <downcase_lithuanian+0x41>
mov    -0x24(%rbp),%eax
sub    $0xcd,%eax
je     1204 <downcase_lithuanian+0xd4>
jmp    1184 <downcase_lithuanian+0x54>
mov    -0x24(%rbp),%eax
sub    $0x128,%eax
je     121f <downcase_lithuanian+0xef>
jmp    1197 <downcase_lithuanian+0x67>
mov    -0x24(%rbp),%eax
sub    $0x12e,%eax
jne    123a <downcase_lithuanian+0x10a>
jmp    11aa <downcase_lithuanian+0x7a>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <has_more_above@plt>
cmp    $0x0,%eax
jne    11cc <downcase_lithuanian+0x9c>
movl   $0x0,-0x4(%rbp)
jmp    1241 <downcase_lithuanian+0x111>
mov    -0x8(%rbp),%edi
call   1040 <u_char_downcase@plt>
mov    %eax,%edi
mov    -0x20(%rbp),%rdx
xor    %esi,%esi
call   1050 <downcase_lithuanian_i@plt>
mov    %eax,-0x4(%rbp)
jmp    1241 <downcase_lithuanian+0x111>
mov    -0x20(%rbp),%rdx
mov    $0x69,%edi
mov    $0x300,%esi
call   1050 <downcase_lithuanian_i@plt>
mov    %eax,-0x4(%rbp)
jmp    1241 <downcase_lithuanian+0x111>
mov    -0x20(%rbp),%rdx
mov    $0x69,%edi
mov    $0x301,%esi
call   1050 <downcase_lithuanian_i@plt>
mov    %eax,-0x4(%rbp)
jmp    1241 <downcase_lithuanian+0x111>
mov    -0x20(%rbp),%rdx
mov    $0x69,%edi
mov    $0x303,%esi
call   1050 <downcase_lithuanian_i@plt>
mov    %eax,-0x4(%rbp)
jmp    1241 <downcase_lithuanian+0x111>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<downcase_lithuanian>:
push   %r14
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %edi,%ebx
cmp    $0xcc,%edi
jg     115d <downcase_lithuanian+0x2d>
lea    -0x49(%rbx),%eax
cmp    $0x2,%eax
jb     1175 <downcase_lithuanian+0x45>
cmp    $0xcc,%ebx
jne    1191 <downcase_lithuanian+0x61>
mov    $0x69,%edi
mov    $0x300,%esi
jmp    11b1 <downcase_lithuanian+0x81>
cmp    $0xcd,%ebx
je     119b <downcase_lithuanian+0x6b>
cmp    $0x128,%ebx
je     11a7 <downcase_lithuanian+0x77>
cmp    $0x12e,%ebx
jne    1191 <downcase_lithuanian+0x61>
mov    %rsi,%rdi
mov    %rdx,%rsi
call   1030 <has_more_above@plt>
test   %eax,%eax
je     1191 <downcase_lithuanian+0x61>
mov    %ebx,%edi
call   1040 <u_char_downcase@plt>
mov    %eax,%edi
xor    %esi,%esi
jmp    11b1 <downcase_lithuanian+0x81>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    $0x69,%edi
mov    $0x301,%esi
jmp    11b1 <downcase_lithuanian+0x81>
mov    $0x69,%edi
mov    $0x303,%esi
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <downcase_lithuanian_i@plt>

LLVM IR (-O0):
%struct.output = type { i32 }
define i32 @downcase_lithuanian(i32 %0, i8* %1, i8* %2, %struct.output* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca %struct.output*
store i32 %0, i32* %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store %struct.output* %3, %struct.output** %9
%10 = load i32, i32* %6
switch i32 %10, label %31 [
i32 73, label %11
i32 74, label %11
i32 302, label %11
i32 204, label %22
i32 205, label %25
i32 296, label %28
]
11: ; preds = %4, %4, %4
%12 = load i8*, i8** %7
%13 = load i8*, i8** %8
%14 = call i32 @has_more_above(i8* %12, i8* %13)
%15 = icmp ne i32 %14, 0
br i1 %15, label %17, label %16
16: ; preds = %11
store i32 0, i32* %5
br label %32
17: ; preds = %11
%18 = load i32, i32* %6
%19 = call i32 @u_char_downcase(i32 %18)
%20 = load %struct.output*, %struct.output** %9
%21 = call i32 @downcase_lithuanian_i(i32 %19, i32 0, %struct.output* %20)
store i32 %21, i32* %5
br label %32
22: ; preds = %4
%23 = load %struct.output*, %struct.output** %9
%24 = call i32 @downcase_lithuanian_i(i32 105, i32 768, %struct.output* %23)
store i32 %24, i32* %5
br label %32
25: ; preds = %4
%26 = load %struct.output*, %struct.output** %9
%27 = call i32 @downcase_lithuanian_i(i32 105, i32 769, %struct.output* %26)
store i32 %27, i32* %5
br label %32
28: ; preds = %4
%29 = load %struct.output*, %struct.output** %9
%30 = call i32 @downcase_lithuanian_i(i32 105, i32 771, %struct.output* %29)
store i32 %30, i32* %5
br label %32
31: ; preds = %4
store i32 0, i32* %5
br label %32
32: ; preds = %31, %28, %25, %22, %17, %16
%33 = load i32, i32* %5
ret i32 %33
}

LLVM IR (-O2):
%struct.output = type { i32 }
define i32 @downcase_lithuanian(i32 %0, i8* %1, i8* %2, %struct.output* %3) {
switch i32 %0, label %17 [
i32 73, label %5
i32 74, label %5
i32 302, label %5
i32 204, label %11
i32 205, label %13
i32 296, label %15
]
5: ; preds = %4, %4, %4
%6 = tail call i32 @has_more_above(i8* %1, i8* %2)
%7 = icmp eq i32 %6, 0
br i1 %7, label %17, label %8
8: ; preds = %5
%9 = tail call i32 @u_char_downcase(i32 %0)
%10 = tail call i32 @downcase_lithuanian_i(i32 %9, i32 0, %struct.output* %3)
br label %17
11: ; preds = %4
%12 = tail call i32 @downcase_lithuanian_i(i32 105, i32 768, %struct.output* %3)
br label %17
13: ; preds = %4
%14 = tail call i32 @downcase_lithuanian_i(i32 105, i32 769, %struct.output* %3)
br label %17
15: ; preds = %4
%16 = tail call i32 @downcase_lithuanian_i(i32 105, i32 771, %struct.output* %3)
br label %17
17: ; preds = %4, %5, %15, %13, %11, %8
%18 = phi i32 [ %16, %15 ], [ %14, %13 ], [ %12, %11 ], [ %10, %8 ], [ 0, %5 ], [ 0, %4 ]
ret i32 %18
}