#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*/ skip_space(char const **);
const char *get_identifier(const char **s) {
  static char buf[1024];
  int i = 0;
  for (;;) {
    if (**s <= ' ')
      break;
    if (i + 2 < 1024) {
      buf[i] = **s;
      i++;
    }
    (*s)++;
  }
  buf[i] = '\0';
  skip_space(s);
  return buf;
}


x86 assembly (clang, -O0):
<get_identifier>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
jg     113b <get_identifier+0x2b>
jmp    117f <get_identifier+0x6f>
mov    -0xc(%rbp),%eax
add    $0x2,%eax
cmp    $0x400,%eax
jge    116c <get_identifier+0x5c>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%dl
movslq -0xc(%rbp),%rcx
lea    0x2ee0(%rip),%rax
mov    %dl,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
jmp    1123 <get_identifier+0x13>
movslq -0xc(%rbp),%rcx
lea    0x2eb6(%rip),%rax
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rdi
call   1030 <skip_space@plt>
lea    0x2ea2(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_identifier>:
push   %rbx
mov    (%rdi),%rcx
mov    (%rcx),%bl
xor    %eax,%eax
cmp    $0x21,%bl
jge    1134 <get_identifier+0x24>
cltq
lea    0x2f1a(%rip),%rbx
movb   $0x0,(%rax,%rbx,1)
call   1030 <skip_space@plt>
mov    %rbx,%rax
pop    %rbx
ret
xor    %eax,%eax
lea    0x2f03(%rip),%rdx
jmp    1153 <get_identifier+0x43>
nop
lea    0x1(%rcx),%rsi
mov    %rsi,(%rdi)
movzbl 0x1(%rcx),%ebx
mov    %rsi,%rcx
cmp    $0x20,%bl
jle    111d <get_identifier+0xd>
cmp    $0x3fd,%eax
jg     1140 <get_identifier+0x30>
movslq %eax,%rcx
mov    %bl,(%rcx,%rdx,1)
add    $0x1,%eax
mov    (%rdi),%rcx
jmp    1140 <get_identifier+0x30>

LLVM IR (-O0):
@get_identifier.buf = internal global [1024 x i8] zeroinitializer
define i8* @get_identifier(i8** %0) {
%2 = alloca i8**
%3 = alloca i32
store i8** %0, i8*** %2
store i32 0, i32* %3
br label %4
4: ; preds = %24, %1
%5 = load i8**, i8*** %2
%6 = load i8*, i8** %5
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 32
br i1 %9, label %10, label %11
10: ; preds = %4
br label %28
11: ; preds = %4
%12 = load i32, i32* %3
%13 = add nsw i32 %12, 2
%14 = icmp slt i32 %13, 1024
br i1 %14, label %15, label %24
15: ; preds = %11
%16 = load i8**, i8*** %2
%17 = load i8*, i8** %16
%18 = load i8, i8* %17
%19 = load i32, i32* %3
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds [1024 x i8], [1024 x i8]* @get_identifier.buf, i64 0, i64 %20
store i8 %18, i8* %21
%22 = load i32, i32* %3
%23 = add nsw i32 %22, 1
store i32 %23, i32* %3
br label %24
24: ; preds = %15, %11
%25 = load i8**, i8*** %2
%26 = load i8*, i8** %25
%27 = getelementptr inbounds i8, i8* %26, i32 1
store i8* %27, i8** %25
br label %4
28: ; preds = %10
%29 = load i32, i32* %3
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds [1024 x i8], [1024 x i8]* @get_identifier.buf, i64 0, i64 %30
store i8 0, i8* %31
%32 = load i8**, i8*** %2
%33 = call i32 @skip_space(i8** %32)
ret i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @get_identifier.buf, i64 0, i64 0)
}

LLVM IR (-O2):
@get_identifier.buf = internal global [1024 x i8] zeroinitializer
define i8* @get_identifier(i8** %0) {
%2 = load i8*, i8** %0
%3 = load i8, i8* %2
%4 = icmp slt i8 %3, 33
br i1 %4, label %21, label %5
5: ; preds = %1, %15
%6 = phi i8* [ %18, %15 ], [ %2, %1 ]
%7 = phi i8 [ %19, %15 ], [ %3, %1 ]
%8 = phi i32 [ %17, %15 ], [ 0, %1 ]
%9 = icmp slt i32 %8, 1022
br i1 %9, label %10, label %15
10: ; preds = %5
%11 = sext i32 %8 to i64
%12 = getelementptr inbounds [1024 x i8], [1024 x i8]* @get_identifier.buf, i64 0, i64 %11
store i8 %7, i8* %12
%13 = add nsw i32 %8, 1
%14 = load i8*, i8** %0
br label %15
15: ; preds = %10, %5
%16 = phi i8* [ %14, %10 ], [ %6, %5 ]
%17 = phi i32 [ %13, %10 ], [ %8, %5 ]
%18 = getelementptr inbounds i8, i8* %16, i64 1
store i8* %18, i8** %0
%19 = load i8, i8* %18
%20 = icmp slt i8 %19, 33
br i1 %20, label %21, label %5
21: ; preds = %15, %1
%22 = phi i32 [ 0, %1 ], [ %17, %15 ]
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds [1024 x i8], [1024 x i8]* @get_identifier.buf, i64 0, i64 %23
store i8 0, i8* %24
%25 = tail call i32 @skip_space(i8** %0)
ret i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @get_identifier.buf, i64 0, i64 0)
}