#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__ isspace(unsigned char);
char tolower(char);
void transformkey(char *start) {
  char *next;
  for (next = start; *start != '\0'; start++, next++) {
    while (isspace((unsigned char)*next) && *next != '\0') {
      next++;
    }
    *start = tolower(*next);
  }
}


x86 assembly (clang, -O0):
<transformkey>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     11c9 <transformkey+0xa9>
jmp    1149 <transformkey+0x29>
mov    -0x10(%rbp),%rax
movzbl (%rax),%edi
call   1030 <isspace@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x11(%rbp)
je     1177 <transformkey+0x57>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1187 <transformkey+0x67>
jmp    1198 <transformkey+0x78>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1149 <transformkey+0x29>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1040 <tolower@plt>
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1134 <transformkey+0x14>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<transformkey>:
push   %r14
push   %rbx
push   %rax
mov    (%rdi),%al
test   %al,%al
je     117e <transformkey+0x5e>
mov    %rdi,%rbx
mov    %rdi,%r14
movzbl %al,%edi
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
call   1030 <isspace@plt>
test   %rax,%rax
je     1160 <transformkey+0x40>
cmpb   $0x0,(%rbx)
je     1160 <transformkey+0x40>
movzbl 0x1(%rbx),%edi
add    $0x1,%rbx
jmp    1140 <transformkey+0x20>
nopl   0x0(%rax)
movsbl (%rbx),%edi
call   1040 <tolower@plt>
mov    %al,(%r14)
cmpb   $0x0,0x1(%r14)
je     117e <transformkey+0x5e>
add    $0x1,%r14
add    $0x1,%rbx
mov    (%rbx),%al
jmp    1130 <transformkey+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @transformkey(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
br label %5
5: ; preds = %31, %1
%6 = load i8*, i8** %2
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %36
10: ; preds = %5
br label %11
11: ; preds = %23, %10
%12 = load i8*, i8** %3
%13 = load i8, i8* %12
%14 = call i64 @isspace(i8 zeroext %13)
%15 = icmp ne i64 %14, 0
br i1 %15, label %16, label %21
16: ; preds = %11
%17 = load i8*, i8** %3
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = icmp ne i32 %19, 0
br label %21
21: ; preds = %16, %11
%22 = phi i1 [ false, %11 ], [ %20, %16 ]
br i1 %22, label %23, label %26
23: ; preds = %21
%24 = load i8*, i8** %3
%25 = getelementptr inbounds i8, i8* %24, i32 1
store i8* %25, i8** %3
br label %11
26: ; preds = %21
%27 = load i8*, i8** %3
%28 = load i8, i8* %27
%29 = call signext i8 @tolower(i8 signext %28)
%30 = load i8*, i8** %2
store i8 %29, i8* %30
br label %31
31: ; preds = %26
%32 = load i8*, i8** %2
%33 = getelementptr inbounds i8, i8* %32, i32 1
store i8* %33, i8** %2
%34 = load i8*, i8** %3
%35 = getelementptr inbounds i8, i8* %34, i32 1
store i8* %35, i8** %3
br label %5
36: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @transformkey(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %29, label %4
4: ; preds = %1, %27
%5 = phi i8 [ %28, %27 ], [ %2, %1 ]
%6 = phi i8* [ %24, %27 ], [ %0, %1 ]
%7 = phi i8* [ %23, %27 ], [ %0, %1 ]
%8 = tail call i64 @isspace(i8 zeroext %5)
%9 = icmp eq i64 %8, 0
br i1 %9, label %19, label %10
10: ; preds = %4, %14
%11 = phi i8* [ %15, %14 ], [ %6, %4 ]
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %19, label %14
14: ; preds = %10
%15 = getelementptr inbounds i8, i8* %11, i64 1
%16 = load i8, i8* %15
%17 = tail call i64 @isspace(i8 zeroext %16)
%18 = icmp eq i64 %17, 0
br i1 %18, label %19, label %10
19: ; preds = %10, %14, %4
%20 = phi i8* [ %6, %4 ], [ %15, %14 ], [ %11, %10 ]
%21 = load i8, i8* %20
%22 = tail call signext i8 @tolower(i8 signext %21)
store i8 %22, i8* %7
%23 = getelementptr inbounds i8, i8* %7, i64 1
%24 = getelementptr inbounds i8, i8* %20, i64 1
%25 = load i8, i8* %23
%26 = icmp eq i8 %25, 0
br i1 %26, label %29, label %27
27: ; preds = %19
%28 = load i8, i8* %24
br label %4
29: ; preds = %19, %1
ret void
}