#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 EXIT_SUCCESS;
char *lookup_addr(char *);
char *lookup_mail(char *);
int /*<<< orphan*/ printf(char *, char const *);
int /*<<< orphan*/ puts(char *);
int main(void) {
  char const *res1 = lookup_addr("giovanna");
  char const *res2 = lookup_addr("giovanni");
  if (res1 != NULL) {
    printf("%s\n", res1);
    printf("%s\n", lookup_mail("giovanna"));
  } else
    puts("Not found");
  if (res2 == NULL)
    puts("Not found");
  return (EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
call   1050 <lookup_addr@plt>
mov    %rax,-0x10(%rbp)
lea    0xea3(%rip),%rdi
call   1050 <lookup_addr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     11aa <main+0x6a>
mov    -0x10(%rbp),%rsi
lea    0xe8d(%rip),%rdi
call   1060 <printf@plt>
lea    0xe6f(%rip),%rdi
call   1030 <lookup_mail@plt>
mov    %rax,%rsi
lea    0xe72(%rip),%rdi
call   1060 <printf@plt>
jmp    11b6 <main+0x76>
lea    0xe65(%rip),%rdi
call   1040 <puts@plt>
cmpq   $0x0,-0x18(%rbp)
jne    11cd <main+0x8d>
lea    0xe4e(%rip),%rdi
call   1040 <puts@plt>
mov    0x2e0c(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
lea    0xeb4(%rip),%rdi
call   1050 <lookup_addr@plt>
mov    %rax,%rbx
lea    0xeae(%rip),%rdi
call   1050 <lookup_addr@plt>
mov    %rax,%r14
test   %rbx,%rbx
je     11b1 <main+0x71>
lea    0xea3(%rip),%r15
mov    %r15,%rdi
mov    %rbx,%rsi
call   1060 <printf@plt>
lea    0xe7f(%rip),%rdi
call   1030 <lookup_mail@plt>
mov    %r15,%rdi
mov    %rax,%rsi
call   1060 <printf@plt>
test   %r14,%r14
jne    11a2 <main+0x62>
lea    0xe79(%rip),%rdi
call   1040 <puts@plt>
mov    0x2e37(%rip),%rax
mov    (%rax),%eax
pop    %rbx
pop    %r14
pop    %r15
ret
lea    0xe5e(%rip),%rdi
call   1040 <puts@plt>
test   %r14,%r14
jne    11a2 <main+0x62>
jmp    1196 <main+0x56>

LLVM IR (-O0):
@.str = [9 x i8] c"giovanna\00"
@.str.1 = [9 x i8] c"giovanni\00"
@.str.2 = [4 x i8] c"%s\0A\00"
@.str.3 = [10 x i8] c"Not found\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
store i32 0, i32* %1
%4 = call i8* @lookup_addr(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
store i8* %4, i8** %2
%5 = call i8* @lookup_addr(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
store i8* %5, i8** %3
%6 = load i8*, i8** %2
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %13
8: ; preds = %0
%9 = load i8*, i8** %2
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %9)
%11 = call i8* @lookup_mail(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%12 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %11)
br label %15
13: ; preds = %0
%14 = call i32 @puts(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
br label %15
15: ; preds = %13, %8
%16 = load i8*, i8** %3
%17 = icmp eq i8* %16, null
br i1 %17, label %18, label %20
18: ; preds = %15
%19 = call i32 @puts(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
br label %20
20: ; preds = %18, %15
%21 = load i32, i32* @EXIT_SUCCESS
ret i32 %21
}

LLVM IR (-O2):
@.str = [9 x i8] c"giovanna\00"
@.str.1 = [9 x i8] c"giovanni\00"
@.str.2 = [4 x i8] c"%s\0A\00"
@.str.3 = [10 x i8] c"Not found\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i8* @lookup_addr(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%2 = tail call i8* @lookup_addr(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%3 = icmp eq i8* %1, null
br i1 %3, label %8, label %4
4: ; preds = %0
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %1)
%6 = tail call i8* @lookup_mail(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %6)
br label %10
8: ; preds = %0
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
br label %10
10: ; preds = %8, %4
%11 = icmp eq i8* %2, null
br i1 %11, label %12, label %14
12: ; preds = %10
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
br label %14
14: ; preds = %12, %10
%15 = load i32, i32* @EXIT_SUCCESS
ret i32 %15
}