#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 /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *,
                           char const *);
int /*<<< orphan*/ stderr;
size_t strspn(char const *, char *);
void check_float(const char *param, const char *value) {
  if (value[strspn(value, ".0123456789")] != 0) {
    fprintf(stderr, "Incorrect value of --%s: `%s'\n", param, value);
    exit(1);
  }
}


x86 assembly (clang, -O0):
<check_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xead(%rip),%rsi
call   1030 <strspn@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1193 <check_float+0x63>
mov    0x2e6d(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xe88(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_float>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
lea    0xebf(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strspn@plt>
cmpb   $0x0,(%rbx,%rax,1)
jne    1157 <check_float+0x27>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    0x2e82(%rip),%rax
mov    (%rax),%edi
lea    0xea5(%rip),%rsi
mov    %r14,%rdx
mov    %rbx,%rcx
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [12 x i8] c".0123456789\00"
@stderr = global i32 0
@.str.1 = [31 x i8] c"Incorrect value of --%s: `%s'\0A\00"
define void @check_float(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = load i8*, i8** %4
%7 = call i64 @strspn(i8* %6, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%8 = getelementptr inbounds i8, i8* %5, i64 %7
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %18
12: ; preds = %2
%13 = load i32, i32* @stderr
%14 = load i8*, i8** %3
%15 = load i8*, i8** %4
%16 = call i32 @fprintf(i32 %13, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), i8* %14, i8* %15)
%17 = call i32 @exit(i32 1)
unreachable
18: ; preds = %2
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c".0123456789\00"
@stderr = global i32 0
@.str.1 = [31 x i8] c"Incorrect value of --%s: `%s'\0A\00"
define void @check_float(i8* %0, i8* %1) {
%3 = tail call i64 @strspn(i8* %1, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds i8, i8* %1, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %2
%8 = load i32, i32* @stderr
%9 = tail call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), i8* %0, i8* %1)
%10 = tail call i32 @exit(i32 1)
unreachable
11: ; preds = %2
ret void
}