#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__ strcmp(char const *, char *);
int dymTableCheckName(const char *name) {
  int i = 0;
  if (name == NULL)
    return 0;
  if (strcmp(name, "NoName") == 0)
    return 0;
  while (*name) {
    if (*name != ' ') {
      i = 1;
      break;
    }
    name++;
  }
  return i;
}


x86 assembly (clang, -O0):
<dymTableCheckName>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    113a <dymTableCheckName+0x2a>
movl   $0x0,-0x4(%rbp)
jmp    11a5 <dymTableCheckName+0x95>
mov    -0x10(%rbp),%rdi
lea    0xebb(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1160 <dymTableCheckName+0x50>
movl   $0x0,-0x4(%rbp)
jmp    11a5 <dymTableCheckName+0x95>
jmp    1165 <dymTableCheckName+0x55>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     119f <dymTableCheckName+0x8f>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
je     118e <dymTableCheckName+0x7e>
movl   $0x1,-0x14(%rbp)
jmp    119f <dymTableCheckName+0x8f>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1165 <dymTableCheckName+0x55>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dymTableCheckName>:
push   %rbp
push   %rbx
push   %rax
xor    %ebp,%ebp
test   %rdi,%rdi
je     1146 <dymTableCheckName+0x36>
mov    %rdi,%rbx
lea    0xedc(%rip),%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1146 <dymTableCheckName+0x36>
xchg   %ax,%ax
movzbl (%rbx),%eax
cmp    $0x20,%al
jne    113d <dymTableCheckName+0x2d>
add    $0x1,%rbx
jmp    1130 <dymTableCheckName+0x20>
test   %al,%al
je     1146 <dymTableCheckName+0x36>
mov    $0x1,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"NoName\00"
define i32 @dymTableCheckName(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %12, label %3
3: ; preds = %1
%4 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i64 %4, 0
br i1 %5, label %12, label %6
6: ; preds = %3, %9
%7 = phi i8* [ %10, %9 ], [ %0, %3 ]
%8 = load i8, i8* %7
switch i8 %8, label %12 [
i8 0, label %11
i8 32, label %9
]
9: ; preds = %6
%10 = getelementptr inbounds i8, i8* %7, i64 1
br label %6
11: ; preds = %6
br label %12
12: ; preds = %6, %11, %3, %1
%13 = phi i32 [ 0, %1 ], [ 0, %3 ], [ 0, %11 ], [ 1, %6 ]
ret i32 %13
}