#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__ isdigit(int);
char *strip_move_number(char *str) {
  while (isdigit((int)*str)) {
    str++;
  }
  while (*str == '.') {
    str++;
  }
  if (*str != '\0') {
    return str;
  } else {
    return (char *)NULL;
  }
}


x86 assembly (clang, -O0):
<strip_move_number>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
je     1143 <strip_move_number+0x33>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    111c <strip_move_number+0xc>
jmp    1148 <strip_move_number+0x38>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2e,%eax
jne    1169 <strip_move_number+0x59>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1148 <strip_move_number+0x38>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1186 <strip_move_number+0x76>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    118e <strip_move_number+0x7e>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strip_move_number>:
push   %rbx
mov    %rdi,%rbx
add    $0xffffffffffffffff,%rbx
nopl   0x0(%rax,%rax,1)
movsbl 0x1(%rbx),%edi
add    $0x1,%rbx
call   1030 <isdigit@plt>
test   %rax,%rax
jne    1120 <strip_move_number+0x10>
jmp    1144 <strip_move_number+0x34>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x1,%rbx
movzbl (%rbx),%eax
cmp    $0x2e,%al
je     1140 <strip_move_number+0x30>
test   %al,%al
jne    1151 <strip_move_number+0x41>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @strip_move_number(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
br label %4
4: ; preds = %10, %1
%5 = load i8*, i8** %3
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = call i64 @isdigit(i32 %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %4
%11 = load i8*, i8** %3
%12 = getelementptr inbounds i8, i8* %11, i32 1
store i8* %12, i8** %3
br label %4
13: ; preds = %4
br label %14
14: ; preds = %19, %13
%15 = load i8*, i8** %3
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %17, 46
br i1 %18, label %19, label %22
19: ; preds = %14
%20 = load i8*, i8** %3
%21 = getelementptr inbounds i8, i8* %20, i32 1
store i8* %21, i8** %3
br label %14
22: ; preds = %14
%23 = load i8*, i8** %3
%24 = load i8, i8* %23
%25 = sext i8 %24 to i32
%26 = icmp ne i32 %25, 0
br i1 %26, label %27, label %29
27: ; preds = %22
%28 = load i8*, i8** %3
store i8* %28, i8** %2
br label %30
29: ; preds = %22
store i8* null, i8** %2
br label %30
30: ; preds = %29, %27
%31 = load i8*, i8** %2
ret i8* %31
}

LLVM IR (-O2):
define i8* @strip_move_number(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %8, %2 ]
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = tail call i64 @isdigit(i32 %5)
%7 = icmp eq i64 %6, 0
%8 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %7, label %9, label %2
9: ; preds = %2, %12
%10 = phi i8* [ %13, %12 ], [ %3, %2 ]
%11 = load i8, i8* %10
switch i8 %11, label %14 [
i8 46, label %12
i8 0, label %15
]
12: ; preds = %9
%13 = getelementptr inbounds i8, i8* %10, i64 1
br label %9
14: ; preds = %9
br label %15
15: ; preds = %9, %14
%16 = phi i8* [ %10, %14 ], [ null, %9 ]
ret i8* %16
}