#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 */
struct Address {
  int dummy;
};

/* Variables and functions */
struct Address *createAdress(char *, char *, char *, int);
int /*<<< orphan*/ destroyAddress(struct Address *);
int /*<<< orphan*/ printAddress(struct Address *);
int main(int argc, char **argv) {
  struct Address *Sam = createAdress("Sam", "Example", "sam@example.com", 40);
  struct Address *Mike =
      createAdress("Mike", "Example", "mike@example.com", 37);
  printAddress(Sam);
  printAddress(Mike);
  destroyAddress(Sam);
  destroyAddress(Mike);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeb3(%rip),%rdi
lea    0xeb0(%rip),%rsi
lea    0xeb1(%rip),%rdx
mov    $0x28,%ecx
call   1030 <createAdress@plt>
mov    %rax,-0x18(%rbp)
lea    0xeac(%rip),%rdi
lea    0xe8d(%rip),%rsi
lea    0xea3(%rip),%rdx
mov    $0x25,%ecx
call   1030 <createAdress@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <printAddress@plt>
mov    -0x20(%rbp),%rdi
call   1040 <printAddress@plt>
mov    -0x18(%rbp),%rdi
call   1050 <destroyAddress@plt>
mov    -0x20(%rbp),%rdi
call   1050 <destroyAddress@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
lea    0xec4(%rip),%rdi
lea    0xec1(%rip),%r14
lea    0xec2(%rip),%rdx
mov    %r14,%rsi
mov    $0x28,%ecx
call   1030 <createAdress@plt>
mov    %rax,%r15
lea    0xebb(%rip),%rdi
lea    0xeb9(%rip),%rdx
mov    %r14,%rsi
mov    $0x25,%ecx
call   1030 <createAdress@plt>
mov    %rax,%rbx
mov    %r15,%rdi
call   1040 <printAddress@plt>
mov    %rbx,%rdi
call   1040 <printAddress@plt>
mov    %r15,%rdi
call   1050 <destroyAddress@plt>
mov    %rbx,%rdi
call   1050 <destroyAddress@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.Address = type { i32 }
@.str = [4 x i8] c"Sam\00"
@.str.1 = [8 x i8] c"Example\00"
@.str.2 = [16 x i8] c"sam@example.com\00"
@.str.3 = [5 x i8] c"Mike\00"
@.str.4 = [17 x i8] c"mike@example.com\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.Address*
%7 = alloca %struct.Address*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call %struct.Address* @createAdress(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 40)
store %struct.Address* %8, %struct.Address** %6
%9 = call %struct.Address* @createAdress(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0), i32 37)
store %struct.Address* %9, %struct.Address** %7
%10 = load %struct.Address*, %struct.Address** %6
%11 = call i32 @printAddress(%struct.Address* %10)
%12 = load %struct.Address*, %struct.Address** %7
%13 = call i32 @printAddress(%struct.Address* %12)
%14 = load %struct.Address*, %struct.Address** %6
%15 = call i32 @destroyAddress(%struct.Address* %14)
%16 = load %struct.Address*, %struct.Address** %7
%17 = call i32 @destroyAddress(%struct.Address* %16)
ret i32 0
}

LLVM IR (-O2):
%struct.Address = type { i32 }
@.str = [4 x i8] c"Sam\00"
@.str.1 = [8 x i8] c"Example\00"
@.str.2 = [16 x i8] c"sam@example.com\00"
@.str.3 = [5 x i8] c"Mike\00"
@.str.4 = [17 x i8] c"mike@example.com\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call %struct.Address* @createAdress(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 40)
%4 = tail call %struct.Address* @createAdress(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0), i32 37)
%5 = tail call i32 @printAddress(%struct.Address* %3)
%6 = tail call i32 @printAddress(%struct.Address* %4)
%7 = tail call i32 @destroyAddress(%struct.Address* %3)
%8 = tail call i32 @destroyAddress(%struct.Address* %4)
ret i32 0
}