#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 */
typedef int /*<<< orphan*/ yamlified;

/* Variables and functions */
scalar_t__ isalpha(int);
scalar_t__ isdigit(int);
scalar_t__ tolower(int);
char *stess_description_yamlify(const char *description) {
  static char yamlified[40];
  char *dst, *end = yamlified + sizeof(yamlified);
  const char *src;
  for (dst = yamlified, src = description; *src; src++) {
    register int ch = (int)*src;
    if (isalpha(ch)) {
      *(dst++) = (char)tolower(ch);
    } else if (isdigit(ch)) {
      *(dst++) = (char)ch;
    } else if (ch == ' ') {
      *(dst++) = '-';
    }
    if (dst >= end - 1)
      break;
  }
  *dst = '\0';
  return yamlified;
}


x86 assembly (clang, -O0):
<stess_description_yamlify>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
lea    0x2f0d(%rip),%rax
add    $0x28,%rax
mov    %rax,-0x18(%rbp)
lea    0x2efe(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmpb   $0x0,(%rax)
je     122a <stess_description_yamlify+0xfa>
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%edi
call   1050 <isalpha@plt>
cmp    $0x0,%rax
je     11a7 <stess_description_yamlify+0x77>
mov    -0x24(%rbp),%edi
call   1040 <tolower@plt>
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
mov    %cl,(%rax)
jmp    11fa <stess_description_yamlify+0xca>
mov    -0x24(%rbp),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
je     11d4 <stess_description_yamlify+0xa4>
mov    -0x24(%rbp),%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
mov    %cl,(%rax)
jmp    11f5 <stess_description_yamlify+0xc5>
cmpl   $0x20,-0x24(%rbp)
jne    11f0 <stess_description_yamlify+0xc0>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movb   $0x2d,(%rax)
jmp    11f5 <stess_description_yamlify+0xc5>
jmp    11fa <stess_description_yamlify+0xca>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
add    $0xffffffffffffffff,%rcx
cmp    %rcx,%rax
jb     1214 <stess_description_yamlify+0xe4>
jmp    122a <stess_description_yamlify+0xfa>
jmp    1219 <stess_description_yamlify+0xe9>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    115e <stess_description_yamlify+0x2e>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
lea    0x2e18(%rip),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stess_description_yamlify>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    (%rdi),%bl
test   %bl,%bl
je     11ba <stess_description_yamlify+0x8a>
mov    %rdi,%r14
add    $0x1,%r14
lea    0x2f04(%rip),%r15
lea    0x2f24(%rip),%r12
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsbl %bl,%ebp
mov    %ebp,%edi
call   1050 <isalpha@plt>
mov    %ebp,%edi
test   %rax,%rax
je     1180 <stess_description_yamlify+0x50>
call   1040 <tolower@plt>
mov    %rax,%rbx
jmp    11a0 <stess_description_yamlify+0x70>
nopl   0x0(%rax,%rax,1)
call   1030 <isdigit@plt>
test   %rax,%rax
jne    11a0 <stess_description_yamlify+0x70>
cmp    $0x20,%bl
mov    $0x2d,%bl
jne    11a7 <stess_description_yamlify+0x77>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %bl,(%r15)
add    $0x1,%r15
cmp    %r12,%r15
jae    11c1 <stess_description_yamlify+0x91>
movzbl (%r14),%ebx
add    $0x1,%r14
test   %bl,%bl
jne    1160 <stess_description_yamlify+0x30>
jmp    11c1 <stess_description_yamlify+0x91>
lea    0x2e8f(%rip),%r15
movb   $0x0,(%r15)
lea    0x2e84(%rip),%rax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@stess_description_yamlify.yamlified = internal global [40 x i8] zeroinitializer
define i8* @stess_description_yamlify(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %2
store i8* getelementptr inbounds ([40 x i8], [40 x i8]* @stess_description_yamlify.yamlified, i64 1, i64 0), i8** %4
store i8* getelementptr inbounds ([40 x i8], [40 x i8]* @stess_description_yamlify.yamlified, i64 0, i64 0), i8** %3
%7 = load i8*, i8** %2
store i8* %7, i8** %5
br label %8
8: ; preds = %49, %1
%9 = load i8*, i8** %5
%10 = load i8, i8* %9
%11 = icmp ne i8 %10, 0
br i1 %11, label %12, label %52
12: ; preds = %8
%13 = load i8*, i8** %5
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
store i32 %15, i32* %6
%16 = load i32, i32* %6
%17 = call i64 @isalpha(i32 %16)
%18 = icmp ne i64 %17, 0
br i1 %18, label %19, label %25
19: ; preds = %12
%20 = load i32, i32* %6
%21 = call i64 @tolower(i32 %20)
%22 = trunc i64 %21 to i8
%23 = load i8*, i8** %3
%24 = getelementptr inbounds i8, i8* %23, i32 1
store i8* %24, i8** %3
store i8 %22, i8* %23
br label %42
25: ; preds = %12
%26 = load i32, i32* %6
%27 = call i64 @isdigit(i32 %26)
%28 = icmp ne i64 %27, 0
br i1 %28, label %29, label %34
29: ; preds = %25
%30 = load i32, i32* %6
%31 = trunc i32 %30 to i8
%32 = load i8*, i8** %3
%33 = getelementptr inbounds i8, i8* %32, i32 1
store i8* %33, i8** %3
store i8 %31, i8* %32
br label %41
34: ; preds = %25
%35 = load i32, i32* %6
%36 = icmp eq i32 %35, 32
br i1 %36, label %37, label %40
37: ; preds = %34
%38 = load i8*, i8** %3
%39 = getelementptr inbounds i8, i8* %38, i32 1
store i8* %39, i8** %3
store i8 45, i8* %38
br label %40
40: ; preds = %37, %34
br label %41
41: ; preds = %40, %29
br label %42
42: ; preds = %41, %19
%43 = load i8*, i8** %3
%44 = load i8*, i8** %4
%45 = getelementptr inbounds i8, i8* %44, i64 -1
%46 = icmp uge i8* %43, %45
br i1 %46, label %47, label %48
47: ; preds = %42
br label %52
48: ; preds = %42
br label %49
49: ; preds = %48
%50 = load i8*, i8** %5
%51 = getelementptr inbounds i8, i8* %50, i32 1
store i8* %51, i8** %5
br label %8
52: ; preds = %47, %8
%53 = load i8*, i8** %3
store i8 0, i8* %53
ret i8* getelementptr inbounds ([40 x i8], [40 x i8]* @stess_description_yamlify.yamlified, i64 0, i64 0)
}

LLVM IR (-O2):
@stess_description_yamlify.yamlified = internal global [40 x i8] zeroinitializer
define i8* @stess_description_yamlify(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %29, label %7
4: ; preds = %25
%5 = load i8, i8* %28
%6 = icmp eq i8 %5, 0
br i1 %6, label %29, label %7
7: ; preds = %1, %4
%8 = phi i8 [ %5, %4 ], [ %2, %1 ]
%9 = phi i8* [ %26, %4 ], [ getelementptr inbounds ([40 x i8], [40 x i8]* @stess_description_yamlify.yamlified, i64 0, i64 0), %1 ]
%10 = phi i8* [ %28, %4 ], [ %0, %1 ]
%11 = sext i8 %8 to i32
%12 = tail call i64 @isalpha(i32 %11)
%13 = icmp eq i64 %12, 0
br i1 %13, label %17, label %14
14: ; preds = %7
%15 = tail call i64 @tolower(i32 %11)
%16 = trunc i64 %15 to i8
br label %22
17: ; preds = %7
%18 = tail call i64 @isdigit(i32 %11)
%19 = icmp eq i64 %18, 0
br i1 %19, label %20, label %22
20: ; preds = %17
%21 = icmp eq i8 %8, 32
br i1 %21, label %22, label %25
22: ; preds = %20, %17, %14
%23 = phi i8 [ %16, %14 ], [ %8, %17 ], [ 45, %20 ]
%24 = getelementptr inbounds i8, i8* %9, i64 1
store i8 %23, i8* %9
br label %25
25: ; preds = %22, %20
%26 = phi i8* [ %9, %20 ], [ %24, %22 ]
%27 = icmp ult i8* %26, getelementptr inbounds ([40 x i8], [40 x i8]* @stess_description_yamlify.yamlified, i64 0, i64 39)
%28 = getelementptr inbounds i8, i8* %10, i64 1
br i1 %27, label %4, label %29
29: ; preds = %4, %25, %1
%30 = phi i8* [ getelementptr inbounds ([40 x i8], [40 x i8]* @stess_description_yamlify.yamlified, i64 0, i64 0), %1 ], [ %26, %25 ], [ %26, %4 ]
store i8 0, i8* %30
ret i8* getelementptr inbounds ([40 x i8], [40 x i8]* @stess_description_yamlify.yamlified, i64 0, i64 0)
}