#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 */
void scriba_id_remove_extra_symbols(const char *in, char *out) {
  if ((in == NULL) || (out == NULL)) {
    return;
  }
  while (*in) {
    if (((*in >= '0') && (*in <= '9')) || ((*in >= 'a') && (*in <= 'f')) ||
        ((*in >= 'A') && (*in <= 'F'))) {
      *out = *in;
      out++;
    }
    in++;
  }
}


x86 assembly (clang, -O0):
<scriba_id_remove_extra_symbols>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1122 <scriba_id_remove_extra_symbols+0x22>
cmpq   $0x0,-0x10(%rbp)
jne    1127 <scriba_id_remove_extra_symbols+0x27>
jmp    11c2 <scriba_id_remove_extra_symbols+0xc2>
jmp    112c <scriba_id_remove_extra_symbols+0x2c>
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     11c2 <scriba_id_remove_extra_symbols+0xc2>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x30,%eax
jl     1159 <scriba_id_remove_extra_symbols+0x59>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x39,%eax
jle    1199 <scriba_id_remove_extra_symbols+0x99>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x61,%eax
jl     1179 <scriba_id_remove_extra_symbols+0x79>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x66,%eax
jle    1199 <scriba_id_remove_extra_symbols+0x99>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x41,%eax
jl     11b1 <scriba_id_remove_extra_symbols+0xb1>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x46,%eax
jg     11b1 <scriba_id_remove_extra_symbols+0xb1>
mov    -0x8(%rbp),%rax
mov    (%rax),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    112c <scriba_id_remove_extra_symbols+0x2c>
pop    %rbp
ret

x86 assembly (clang, -O2):
<scriba_id_remove_extra_symbols>:
test   %rdi,%rdi
je     114a <scriba_id_remove_extra_symbols+0x4a>
test   %rsi,%rsi
je     114a <scriba_id_remove_extra_symbols+0x4a>
mov    (%rdi),%cl
test   %cl,%cl
je     114a <scriba_id_remove_extra_symbols+0x4a>
add    $0x1,%rdi
movabs $0x3f0000003f,%rax
xchg   %ax,%ax
lea    -0x30(%rcx),%edx
cmp    $0xa,%dl
jb     1139 <scriba_id_remove_extra_symbols+0x39>
lea    -0x41(%rcx),%edx
cmp    $0x25,%dl
ja     113f <scriba_id_remove_extra_symbols+0x3f>
movzbl %dl,%edx
bt     %rdx,%rax
jae    113f <scriba_id_remove_extra_symbols+0x3f>
mov    %cl,(%rsi)
add    $0x1,%rsi
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1120 <scriba_id_remove_extra_symbols+0x20>
ret

LLVM IR (-O0):
define void @scriba_id_remove_extra_symbols(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = icmp eq i8* %5, null
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = load i8*, i8** %4
%9 = icmp eq i8* %8, null
br i1 %9, label %10, label %11
10: ; preds = %7, %2
br label %55
11: ; preds = %7
br label %12
12: ; preds = %52, %11
%13 = load i8*, i8** %3
%14 = load i8, i8* %13
%15 = icmp ne i8 %14, 0
br i1 %15, label %16, label %55
16: ; preds = %12
%17 = load i8*, i8** %3
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = icmp sge i32 %19, 48
br i1 %20, label %21, label %26
21: ; preds = %16
%22 = load i8*, i8** %3
%23 = load i8, i8* %22
%24 = sext i8 %23 to i32
%25 = icmp sle i32 %24, 57
br i1 %25, label %46, label %26
26: ; preds = %21, %16
%27 = load i8*, i8** %3
%28 = load i8, i8* %27
%29 = sext i8 %28 to i32
%30 = icmp sge i32 %29, 97
br i1 %30, label %31, label %36
31: ; preds = %26
%32 = load i8*, i8** %3
%33 = load i8, i8* %32
%34 = sext i8 %33 to i32
%35 = icmp sle i32 %34, 102
br i1 %35, label %46, label %36
36: ; preds = %31, %26
%37 = load i8*, i8** %3
%38 = load i8, i8* %37
%39 = sext i8 %38 to i32
%40 = icmp sge i32 %39, 65
br i1 %40, label %41, label %52
41: ; preds = %36
%42 = load i8*, i8** %3
%43 = load i8, i8* %42
%44 = sext i8 %43 to i32
%45 = icmp sle i32 %44, 70
br i1 %45, label %46, label %52
46: ; preds = %41, %31, %21
%47 = load i8*, i8** %3
%48 = load i8, i8* %47
%49 = load i8*, i8** %4
store i8 %48, i8* %49
%50 = load i8*, i8** %4
%51 = getelementptr inbounds i8, i8* %50, i32 1
store i8* %51, i8** %4
br label %52
52: ; preds = %46, %41, %36
%53 = load i8*, i8** %3
%54 = getelementptr inbounds i8, i8* %53, i32 1
store i8* %54, i8** %3
br label %12
55: ; preds = %10, %12
ret void
}

LLVM IR (-O2):
define void @scriba_id_remove_extra_symbols(i8* %0, i8* writeonly %1) {
%3 = icmp eq i8* %0, null
%4 = icmp eq i8* %1, null
%5 = or i1 %3, %4
br i1 %5, label %24, label %6
6: ; preds = %2
%7 = load i8, i8* %0
%8 = icmp eq i8 %7, 0
br i1 %8, label %24, label %9
9: ; preds = %6, %19
%10 = phi i8 [ %22, %19 ], [ %7, %6 ]
%11 = phi i8* [ %20, %19 ], [ %1, %6 ]
%12 = phi i8* [ %21, %19 ], [ %0, %6 ]
%13 = freeze i8 %10
%14 = add i8 %13, -48
%15 = icmp ult i8 %14, 10
br i1 %15, label %17, label %16
16: ; preds = %9
switch i8 %13, label %19 [
i8 102, label %17
i8 101, label %17
i8 100, label %17
i8 99, label %17
i8 98, label %17
i8 97, label %17
i8 70, label %17
i8 69, label %17
i8 68, label %17
i8 67, label %17
i8 66, label %17
i8 65, label %17
]
17: ; preds = %16, %16, %16, %16, %16, %16, %16, %16, %16, %16, %16, %16, %9
store i8 %13, i8* %11
%18 = getelementptr inbounds i8, i8* %11, i64 1
br label %19
19: ; preds = %16, %17
%20 = phi i8* [ %18, %17 ], [ %11, %16 ]
%21 = getelementptr inbounds i8, i8* %12, i64 1
%22 = load i8, i8* %21
%23 = icmp eq i8 %22, 0
br i1 %23, label %24, label %9
24: ; preds = %19, %6, %2
ret void
}