#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 consume_byte(int);
int /*<<< orphan*/ fixup_label();
scalar_t__ in_set(int, char *);
int preserve_keyword(int c) {
  while (in_set(
      c, "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_")) {
    c = consume_byte(c);
  }
  if (':' == c) {
    fixup_label();
    return 32;
  }
  return c;
}


x86 assembly (clang, -O0):
<preserve_keyword>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
lea    0xebb(%rip),%rsi
call   1050 <in_set@plt>
cmp    $0x0,%rax
je     1164 <preserve_keyword+0x34>
mov    -0x8(%rbp),%edi
call   1040 <consume_byte@plt>
mov    %eax,-0x8(%rbp)
jmp    113b <preserve_keyword+0xb>
mov    $0x3a,%eax
cmp    -0x8(%rbp),%eax
jne    1185 <preserve_keyword+0x55>
mov    $0x0,%al
call   1030 <fixup_label@plt>
movl   $0x20,-0x4(%rbp)
jmp    118b <preserve_keyword+0x5b>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<preserve_keyword>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
lea    0xec3(%rip),%rsi
call   1050 <in_set@plt>
test   %rax,%rax
je     1168 <preserve_keyword+0x38>
lea    0xeb2(%rip),%r14
xchg   %ax,%ax
mov    %ebx,%edi
call   1040 <consume_byte@plt>
mov    %eax,%ebx
mov    %eax,%edi
mov    %r14,%rsi
call   1050 <in_set@plt>
test   %rax,%rax
jne    1150 <preserve_keyword+0x20>
cmp    $0x3a,%ebx
jne    1179 <preserve_keyword+0x49>
xor    %eax,%eax
call   1030 <fixup_label@plt>
mov    $0x20,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [64 x i8] c"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_\00"
define i32 @preserve_keyword(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
br label %4
4: ; preds = %8, %1
%5 = load i32, i32* %3
%6 = call i64 @in_set(i32 %5, i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0))
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %4
%9 = load i32, i32* %3
%10 = call i32 @consume_byte(i32 %9)
store i32 %10, i32* %3
br label %4
11: ; preds = %4
%12 = load i32, i32* %3
%13 = icmp eq i32 58, %12
br i1 %13, label %14, label %16
14: ; preds = %11
%15 = call i32 (...) @fixup_label()
store i32 32, i32* %2
br label %18
16: ; preds = %11
%17 = load i32, i32* %3
store i32 %17, i32* %2
br label %18
18: ; preds = %16, %14
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
@.str = [64 x i8] c"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_\00"
define i32 @preserve_keyword(i32 %0) {
%2 = tail call i64 @in_set(i32 %0, i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
br i1 %3, label %9, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %6, %4 ], [ %0, %1 ]
%6 = tail call i32 @consume_byte(i32 %5)
%7 = tail call i64 @in_set(i32 %6, i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0))
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %1
%10 = phi i32 [ %0, %1 ], [ %6, %4 ]
%11 = icmp eq i32 %10, 58
br i1 %11, label %12, label %14
12: ; preds = %9
%13 = tail call i32 (...) @fixup_label()
br label %14
14: ; preds = %9, %12
%15 = phi i32 [ 32, %12 ], [ %10, %9 ]
ret i32 %15
}