#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*/ FILE;

/* Variables and functions */
int fputs(char *, int /*<<< orphan*/ *);
int putc(char const, int /*<<< orphan*/ *);
int html_email(FILE *fp, const char *email) {
  const char *cp;
  int rc = 0;
  for (cp = email; rc >= 0 && *cp; ++cp)
    switch (*cp) {
    case '.':
      rc = fputs(" . ", fp);
      break;
    case '@':
      rc = fputs(" (vid) ", fp);
      break;
    default:
      rc = putc(*cp, fp);
    }
  return rc;
}


x86 assembly (clang, -O0):
<html_email>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x1c(%rbp)
mov    %al,-0x1d(%rbp)
jl     115e <html_email+0x3e>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x1d(%rbp)
mov    -0x1d(%rbp),%al
test   $0x1,%al
jne    116e <html_email+0x4e>
jmp    11f2 <html_email+0xd2>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
mov    %eax,-0x24(%rbp)
sub    $0x2e,%eax
je     1197 <html_email+0x77>
jmp    1186 <html_email+0x66>
mov    -0x24(%rbp),%eax
sub    $0x40,%eax
je     11af <html_email+0x8f>
jmp    11c7 <html_email+0xa7>
mov    -0x8(%rbp),%rsi
lea    0xe5e(%rip),%rdi
call   1030 <fputs@plt>
mov    %eax,-0x1c(%rbp)
jmp    11dc <html_email+0xbc>
mov    -0x8(%rbp),%rsi
lea    0xe4a(%rip),%rdi
call   1030 <fputs@plt>
mov    %eax,-0x1c(%rbp)
jmp    11dc <html_email+0xbc>
mov    -0x18(%rbp),%rax
mov    (%rax),%al
mov    -0x8(%rbp),%rsi
movsbl %al,%edi
call   1040 <putc@plt>
mov    %eax,-0x1c(%rbp)
jmp    11e1 <html_email+0xc1>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    113f <html_email+0x1f>
mov    -0x1c(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<html_email>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    (%rsi),%cl
test   %cl,%cl
je     11a9 <html_email+0x89>
mov    %rsi,%rbx
mov    %rdi,%r14
add    $0x1,%rbx
lea    0xec5(%rip),%r15
lea    0xeba(%rip),%r12
cs nopw 0x0(%rax,%rax,1)
movsbl %cl,%edi
cmp    $0x40,%edi
je     1170 <html_email+0x50>
cmp    $0x2e,%edi
jne    1190 <html_email+0x70>
mov    %r12,%rdi
jmp    1173 <html_email+0x53>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r15,%rdi
mov    %r14,%rsi
call   1030 <fputs@plt>
test   %eax,%eax
jns    119c <html_email+0x7c>
jmp    11ab <html_email+0x8b>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r14,%rsi
call   1040 <putc@plt>
test   %eax,%eax
js     11ab <html_email+0x8b>
movzbl (%rbx),%ecx
add    $0x1,%rbx
test   %cl,%cl
jne    1150 <html_email+0x30>
jmp    11ab <html_email+0x8b>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

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