#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__ isalpha(unsigned char);
int Is_A_DFormat(const char *string) {
  return string[0] && string[0] != '-' &&
         !(isalpha((unsigned char)string[0]) || string[0] == '_');
}


x86 assembly (clang, -O0):
<Is_A_DFormat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     117c <Is_A_DFormat+0x6c>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x2d,%ecx
mov    %al,-0x9(%rbp)
je     117c <Is_A_DFormat+0x6c>
mov    -0x8(%rbp),%rax
movzbl (%rax),%edi
call   1030 <isalpha@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0xa(%rbp)
jne    1174 <Is_A_DFormat+0x64>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5f,%eax
sete   %al
mov    %al,-0xa(%rbp)
mov    -0xa(%rbp),%al
xor    $0xff,%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Is_A_DFormat>:
push   %rbp
push   %rbx
push   %rax
mov    (%rdi),%al
xor    %ebp,%ebp
test   %al,%al
je     1138 <Is_A_DFormat+0x28>
cmp    $0x2d,%al
je     1138 <Is_A_DFormat+0x28>
mov    %rdi,%rbx
movzbl %al,%edi
call   1030 <isalpha@plt>
test   %rax,%rax
jne    1138 <Is_A_DFormat+0x28>
xor    %ebp,%ebp
cmpb   $0x5f,(%rbx)
setne  %bpl
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @Is_A_DFormat(i8* nocapture %0) {
%2 = load i8, i8* %0
switch i8 %2, label %3 [
i8 0, label %10
i8 45, label %10
]
3: ; preds = %1
%4 = tail call i64 @isalpha(i8 zeroext %2)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = load i8, i8* %0
%8 = icmp ne i8 %7, 95
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %3, %6, %1, %1
%11 = phi i32 [ 0, %1 ], [ 0, %1 ], [ 0, %3 ], [ %9, %6 ]
ret i32 %11
}