#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 fputs(char *, int /*<<< orphan*/);
int h_putc(char const);
int /*<<< orphan*/ stdout;
int h_email(const char *email) {
  const char *cp;
  int rc = 0;
  for (cp = email; rc >= 0 && *cp; ++cp)
    switch (*cp) {
    case '.':
      rc = fputs(" . ", stdout);
      break;
    case '@':
      rc = fputs(" (vid) ", stdout);
      break;
    default:
      rc = h_putc(*cp);
    }
  return rc;
}


x86 assembly (clang, -O0):
<h_email>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x14(%rbp)
mov    %al,-0x15(%rbp)
jl     115a <h_email+0x3a>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
test   $0x1,%al
jne    116a <h_email+0x4a>
jmp    11f2 <h_email+0xd2>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    %eax,-0x1c(%rbp)
sub    $0x2e,%eax
je     1193 <h_email+0x73>
jmp    1182 <h_email+0x62>
mov    -0x1c(%rbp),%eax
sub    $0x40,%eax
je     11b0 <h_email+0x90>
jmp    11cd <h_email+0xad>
mov    0x2e46(%rip),%rax
mov    (%rax),%esi
lea    0xe5d(%rip),%rdi
call   1040 <fputs@plt>
mov    %eax,-0x14(%rbp)
jmp    11dc <h_email+0xbc>
mov    0x2e29(%rip),%rax
mov    (%rax),%esi
lea    0xe44(%rip),%rdi
call   1040 <fputs@plt>
mov    %eax,-0x14(%rbp)
jmp    11dc <h_email+0xbc>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <h_putc@plt>
mov    %eax,-0x14(%rbp)
jmp    11e1 <h_email+0xc1>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    113b <h_email+0x1b>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<h_email>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    (%rdi),%cl
test   %cl,%cl
je     1192 <h_email+0x72>
mov    %rdi,%rbx
add    $0x1,%rbx
mov    0x2ea4(%rip),%r12
lea    0xec1(%rip),%r14
lea    0xeb6(%rip),%r15
jmp    1164 <h_email+0x44>
nopl   0x0(%rax)
call   1030 <h_putc@plt>
test   %eax,%eax
js     1194 <h_email+0x74>
movzbl (%rbx),%ecx
add    $0x1,%rbx
test   %cl,%cl
je     1194 <h_email+0x74>
movsbl %cl,%edi
cmp    $0x40,%edi
je     1180 <h_email+0x60>
cmp    $0x2e,%edi
jne    1150 <h_email+0x30>
mov    (%r12),%esi
mov    %r15,%rdi
jmp    1187 <h_email+0x67>
nopw   0x0(%rax,%rax,1)
mov    (%r12),%esi
mov    %r14,%rdi
call   1040 <fputs@plt>
test   %eax,%eax
jns    1159 <h_email+0x39>
jmp    1194 <h_email+0x74>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [4 x i8] c" . \00"
@stdout = global i32 0
@.str.1 = [8 x i8] c" (vid) \00"
define i32 @h_email(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %4
%5 = load i8*, i8** %2
store i8* %5, i8** %3
br label %6
6: ; preds = %31, %1
%7 = load i32, i32* %4
%8 = icmp sge i32 %7, 0
br i1 %8, label %9, label %14
9: ; preds = %6
%10 = load i8*, i8** %3
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp ne i32 %12, 0
br label %14
14: ; preds = %9, %6
%15 = phi i1 [ false, %6 ], [ %13, %9 ]
br i1 %15, label %16, label %34
16: ; preds = %14
%17 = load i8*, i8** %3
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
switch i32 %19, label %26 [
i32 46, label %20
i32 64, label %23
]
20: ; preds = %16
%21 = load i32, i32* @stdout
%22 = call i32 @fputs(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %21)
store i32 %22, i32* %4
br label %30
23: ; preds = %16
%24 = load i32, i32* @stdout
%25 = call i32 @fputs(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %24)
store i32 %25, i32* %4
br label %30
26: ; preds = %16
%27 = load i8*, i8** %3
%28 = load i8, i8* %27
%29 = call i32 @h_putc(i8 signext %28)
store i32 %29, i32* %4
br label %30
30: ; preds = %26, %23, %20
br label %31
31: ; preds = %30
%32 = load i8*, i8** %3
%33 = getelementptr inbounds i8, i8* %32, i32 1
store i8* %33, i8** %3
br label %6
34: ; preds = %14
%35 = load i32, i32* %4
ret i32 %35
}

LLVM IR (-O2):
@.str = [4 x i8] c" . \00"
@stdout = global i32 0
@.str.1 = [8 x i8] c" (vid) \00"
define i32 @h_email(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %23, label %7
4: ; preds = %19
%5 = load i8, i8* %21
%6 = icmp eq i8 %5, 0
br i1 %6, label %23, label %7
7: ; preds = %1, %4
%8 = phi i8 [ %5, %4 ], [ %2, %1 ]
%9 = phi i8* [ %21, %4 ], [ %0, %1 ]
%10 = sext i8 %8 to i32
switch i32 %10, label %17 [
i32 46, label %11
i32 64, label %14
]
11: ; preds = %7
%12 = load i32, i32* @stdout
%13 = tail call i32 @fputs(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %12)
br label %19
14: ; preds = %7
%15 = load i32, i32* @stdout
%16 = tail call i32 @fputs(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %15)
br label %19
17: ; preds = %7
%18 = tail call i32 @h_putc(i8 signext %8)
br label %19
19: ; preds = %11, %14, %17
%20 = phi i32 [ %18, %17 ], [ %16, %14 ], [ %13, %11 ]
%21 = getelementptr inbounds i8, i8* %9, i64 1
%22 = icmp sgt i32 %20, -1
br i1 %22, label %4, label %23
23: ; preds = %4, %19, %1
%24 = phi i32 [ 0, %1 ], [ %20, %19 ], [ %20, %4 ]
ret i32 %24
}