#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 /*<<< orphan*/ printf(char *, ...);
int pEmail(char *value) {
  int flag = 0, index = 0;
  while (value[index] != '\0') {
    if (value[index] == '@')
      flag = 1;
    index++;
  }
  if (!flag)
    printf("The email id does not contain @. Invalid\n");
  else
    printf("Email : %s\n", value);
  return 0;
}


x86 assembly (clang, -O0):
<pEmail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1169 <pEmail+0x59>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x40,%eax
jne    115b <pEmail+0x4b>
movl   $0x1,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    112a <pEmail+0x1a>
cmpl   $0x0,-0xc(%rbp)
jne    1186 <pEmail+0x76>
lea    0xe86(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1198 <pEmail+0x88>
mov    -0x8(%rbp),%rsi
lea    0xe99(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pEmail>:
push   %rax
mov    %rdi,%rsi
xor    %eax,%eax
mov    %rdi,%rcx
jmp    1139 <pEmail+0x19>
nopl   0x0(%rax,%rax,1)
mov    $0x1,%eax
add    $0x1,%rcx
movzbl (%rcx),%edx
cmp    $0x40,%dl
je     1130 <pEmail+0x10>
test   %dl,%dl
jne    1135 <pEmail+0x15>
test   %eax,%eax
je     1159 <pEmail+0x39>
lea    0xeb0(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    1165 <pEmail+0x45>
lea    0xeac(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [42 x i8] c"The email id does not contain @. Invalid\0A\00"
@.str.1 = [12 x i8] c"Email : %s\0A\00"
define i32 @pEmail(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
store i32 0, i32* %4
br label %5
5: ; preds = %22, %1
%6 = load i8*, i8** %2
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %6, i64 %8
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %25
13: ; preds = %5
%14 = load i8*, i8** %2
%15 = load i32, i32* %4
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %14, i64 %16
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = icmp eq i32 %19, 64
br i1 %20, label %21, label %22
21: ; preds = %13
store i32 1, i32* %3
br label %22
22: ; preds = %21, %13
%23 = load i32, i32* %4
%24 = add nsw i32 %23, 1
store i32 %24, i32* %4
br label %5
25: ; preds = %5
%26 = load i32, i32* %3
%27 = icmp ne i32 %26, 0
br i1 %27, label %30, label %28
28: ; preds = %25
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
br label %33
30: ; preds = %25
%31 = load i8*, i8** %2
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* %31)
br label %33
33: ; preds = %30, %28
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [12 x i8] c"Email : %s\0A\00"
@str = [41 x i8] c"The email id does not contain @. Invalid\00"
define i32 @pEmail(i8* %0) {
br label %2
2: ; preds = %8, %1
%3 = phi i64 [ %10, %8 ], [ 0, %1 ]
%4 = phi i32 [ %9, %8 ], [ 0, %1 ]
%5 = getelementptr inbounds i8, i8* %0, i64 %3
%6 = load i8, i8* %5
switch i8 %6, label %8 [
i8 0, label %11
i8 64, label %7
]
7: ; preds = %2
br label %8
8: ; preds = %2, %7
%9 = phi i32 [ 1, %7 ], [ %4, %2 ]
%10 = add nuw i64 %3, 1
br label %2
11: ; preds = %2
%12 = icmp eq i32 %4, 0
br i1 %12, label %13, label %15
13: ; preds = %11
%14 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str, i64 0, i64 0))
br label %17
15: ; preds = %11
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* %0)
br label %17
17: ; preds = %15, %13
ret i32 0
}