#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__ get_glyph_gen(char const *, char *, int /*<<< orphan*/, int,
                         int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ sim_isspace(char const);
int /*<<< orphan*/ strcpy(char *, char *);
const char *get_glyph_cmd(const char *iptr, char *optr) {
  if ((iptr[0] == '!') && (!sim_isspace(iptr[1]))) {
    strcpy(optr, "!");
    return (const char *)(iptr + 1);
  }
  return (const char *)get_glyph_gen(iptr, optr, 0, 1, 0, 0);
}


x86 assembly (clang, -O0):
<get_glyph_cmd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x21,%eax
jne    1187 <get_glyph_cmd+0x57>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%edi
call   1040 <sim_isspace@plt>
cmp    $0x0,%eax
jne    1187 <get_glyph_cmd+0x57>
mov    -0x18(%rbp),%rdi
lea    0xe8f(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    11a6 <get_glyph_cmd+0x76>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
xor    %r9d,%r9d
mov    $0x1,%ecx
mov    %r9d,%edx
mov    %r9d,%r8d
call   1050 <get_glyph_gen@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_glyph_cmd>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
cmpb   $0x21,(%rdi)
jne    114c <get_glyph_cmd+0x1c>
movsbl 0x1(%rbx),%edi
call   1040 <sim_isspace@plt>
test   %eax,%eax
je     1169 <get_glyph_cmd+0x39>
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %edx,%edx
mov    $0x1,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1050 <get_glyph_gen@plt>
mov    %rax,%rbx
jmp    117c <get_glyph_cmd+0x4c>
add    $0x1,%rbx
lea    0xe8c(%rip),%rsi
mov    %r14,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [2 x i8] c"!\00"
define i8* @get_glyph_cmd(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %4
%7 = getelementptr inbounds i8, i8* %6, i64 0
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 33
br i1 %10, label %11, label %22
11: ; preds = %2
%12 = load i8*, i8** %4
%13 = getelementptr inbounds i8, i8* %12, i64 1
%14 = load i8, i8* %13
%15 = call i32 @sim_isspace(i8 signext %14)
%16 = icmp ne i32 %15, 0
br i1 %16, label %22, label %17
17: ; preds = %11
%18 = load i8*, i8** %5
%19 = call i32 @strcpy(i8* %18, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%20 = load i8*, i8** %4
%21 = getelementptr inbounds i8, i8* %20, i64 1
store i8* %21, i8** %3
br label %27
22: ; preds = %11, %2
%23 = load i8*, i8** %4
%24 = load i8*, i8** %5
%25 = call i64 @get_glyph_gen(i8* %23, i8* %24, i32 0, i32 1, i32 0, i32 0)
%26 = inttoptr i64 %25 to i8*
store i8* %26, i8** %3
br label %27
27: ; preds = %22, %17
%28 = load i8*, i8** %3
ret i8* %28
}

LLVM IR (-O2):
@.str = [2 x i8] c"!\00"
define i8* @get_glyph_cmd(i8* %0, i8* %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 33
br i1 %4, label %5, label %12
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %0, i64 1
%7 = load i8, i8* %6
%8 = tail call i32 @sim_isspace(i8 signext %7)
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %5
%11 = tail call i32 @strcpy(i8* %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %15
12: ; preds = %5, %2
%13 = tail call i64 @get_glyph_gen(i8* %0, i8* %1, i32 0, i32 1, i32 0, i32 0)
%14 = inttoptr i64 %13 to i8*
br label %15
15: ; preds = %12, %10
%16 = phi i8* [ %14, %12 ], [ %6, %10 ]
ret i8* %16
}