#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 smtp_address_validate_name(const char *const name) {
  size_t i;
  unsigned char uc;
  for (i = 0; name[i]; i++) {
    uc = (unsigned char)name[i];
    if (uc < ' ' || uc == 127 || uc == '\"') {
      return -1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<smtp_address_validate_name>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1179 <smtp_address_validate_name+0x79>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x19(%rbp)
movzbl -0x19(%rbp),%eax
cmp    $0x20,%eax
jl     1157 <smtp_address_validate_name+0x57>
movzbl -0x19(%rbp),%eax
cmp    $0x7f,%eax
je     1157 <smtp_address_validate_name+0x57>
movzbl -0x19(%rbp),%eax
cmp    $0x22,%eax
jne    1163 <smtp_address_validate_name+0x63>
movl   $0xffffffff,-0x4(%rbp)
jmp    1180 <smtp_address_validate_name+0x80>
jmp    1168 <smtp_address_validate_name+0x68>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1110 <smtp_address_validate_name+0x10>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<smtp_address_validate_name>:
mov    (%rdi),%cl
test   %cl,%cl
je     112a <smtp_address_validate_name+0x2a>
add    $0x1,%rdi
mov    $0xffffffff,%eax
nop
cmp    $0x20,%cl
jb     112c <smtp_address_validate_name+0x2c>
cmp    $0x22,%cl
je     112c <smtp_address_validate_name+0x2c>
cmp    $0x7f,%cl
je     112c <smtp_address_validate_name+0x2c>
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <smtp_address_validate_name+0x10>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @smtp_address_validate_name(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8
store i8* %0, i8** %3
store i64 0, i64* %4
br label %6
6: ; preds = %30, %1
%7 = load i8*, i8** %3
%8 = load i64, i64* %4
%9 = getelementptr inbounds i8, i8* %7, i64 %8
%10 = load i8, i8* %9
%11 = icmp ne i8 %10, 0
br i1 %11, label %12, label %33
12: ; preds = %6
%13 = load i8*, i8** %3
%14 = load i64, i64* %4
%15 = getelementptr inbounds i8, i8* %13, i64 %14
%16 = load i8, i8* %15
store i8 %16, i8* %5
%17 = load i8, i8* %5
%18 = zext i8 %17 to i32
%19 = icmp slt i32 %18, 32
br i1 %19, label %28, label %20
20: ; preds = %12
%21 = load i8, i8* %5
%22 = zext i8 %21 to i32
%23 = icmp eq i32 %22, 127
br i1 %23, label %28, label %24
24: ; preds = %20
%25 = load i8, i8* %5
%26 = zext i8 %25 to i32
%27 = icmp eq i32 %26, 34
br i1 %27, label %28, label %29
28: ; preds = %24, %20, %12
store i32 -1, i32* %2
br label %34
29: ; preds = %24
br label %30
30: ; preds = %29
%31 = load i64, i64* %4
%32 = add i64 %31, 1
store i64 %32, i64* %4
br label %6
33: ; preds = %6
store i32 0, i32* %2
br label %34
34: ; preds = %33, %28
%35 = load i32, i32* %2
ret i32 %35
}

LLVM IR (-O2):
define i32 @smtp_address_validate_name(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %10
%5 = phi i8 [ %13, %10 ], [ %2, %1 ]
%6 = phi i64 [ %11, %10 ], [ 0, %1 ]
%7 = freeze i8 %5
%8 = icmp ult i8 %7, 32
br i1 %8, label %15, label %9
9: ; preds = %4
switch i8 %7, label %10 [
i8 127, label %15
i8 34, label %15
]
10: ; preds = %9
%11 = add i64 %6, 1
%12 = getelementptr inbounds i8, i8* %0, i64 %11
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %9, %9, %4, %10, %1
%16 = phi i32 [ 0, %1 ], [ 0, %10 ], [ -1, %4 ], [ -1, %9 ], [ -1, %9 ]
ret i32 %16
}