#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 Person {
  int dummy;
};

/* Variables and functions */
struct Person *Person_create(char *, int, int, int);
int /*<<< orphan*/ Person_destroy(struct Person *);
int /*<<< orphan*/ Person_print(struct Person *);
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char *argv[]) {
  printf("testing\n");
  struct Person *jonas = Person_create("Jonas Libbrecht", 22, 180, 79);
  printf("Jonas is at memory location %p:\n", jonas);
  Person_print(jonas);
  printf("Destroying object jonas...\n");
  Person_destroy(jonas);
  printf("Jonas is at memory location %p:\n", jonas);
  Person_print(jonas);
  Person_destroy(jonas);
  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    0xea3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe9e(%rip),%rdi
mov    $0x16,%esi
mov    $0xb4,%edx
mov    $0x4f,%ecx
call   1060 <Person_create@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xe8b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1050 <Person_print@plt>
lea    0xe95(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1040 <Person_destroy@plt>
mov    -0x18(%rbp),%rsi
lea    0xe59(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1050 <Person_print@plt>
mov    -0x18(%rbp),%rdi
call   1040 <Person_destroy@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xed6(%rip),%rdi
call   1030 <puts@plt>
lea    0xe99(%rip),%rdi
mov    $0x16,%esi
mov    $0xb4,%edx
mov    $0x4f,%ecx
call   1070 <Person_create@plt>
mov    %rax,%rbx
lea    0xe8b(%rip),%r14
mov    %r14,%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1060 <Person_print@plt>
lea    0xe98(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1050 <Person_destroy@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1060 <Person_print@plt>
mov    %rbx,%rdi
call   1050 <Person_destroy@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.Person = type { i32 }
@.str = [9 x i8] c"testing\0A\00"
@.str.1 = [16 x i8] c"Jonas Libbrecht\00"
@.str.2 = [33 x i8] c"Jonas is at memory location %p:\0A\00"
@.str.3 = [28 x i8] c"Destroying object jonas...\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.Person*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%8 = call %struct.Person* @Person_create(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 22, i32 180, i32 79)
store %struct.Person* %8, %struct.Person** %6
%9 = load %struct.Person*, %struct.Person** %6
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0), %struct.Person* %9)
%11 = load %struct.Person*, %struct.Person** %6
%12 = call i32 @Person_print(%struct.Person* %11)
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0))
%14 = load %struct.Person*, %struct.Person** %6
%15 = call i32 @Person_destroy(%struct.Person* %14)
%16 = load %struct.Person*, %struct.Person** %6
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0), %struct.Person* %16)
%18 = load %struct.Person*, %struct.Person** %6
%19 = call i32 @Person_print(%struct.Person* %18)
%20 = load %struct.Person*, %struct.Person** %6
%21 = call i32 @Person_destroy(%struct.Person* %20)
ret i32 0
}

LLVM IR (-O2):
%struct.Person = type { i32 }
@.str.1 = [16 x i8] c"Jonas Libbrecht\00"
@.str.2 = [33 x i8] c"Jonas is at memory location %p:\0A\00"
@str = [8 x i8] c"testing\00"
@str.4 = [27 x i8] c"Destroying object jonas...\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
%4 = tail call %struct.Person* @Person_create(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 22, i32 180, i32 79)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0), %struct.Person* %4)
%6 = tail call i32 @Person_print(%struct.Person* %4)
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.4, i64 0, i64 0))
%8 = tail call i32 @Person_destroy(%struct.Person* %4)
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0), %struct.Person* %4)
%10 = tail call i32 @Person_print(%struct.Person* %4)
%11 = tail call i32 @Person_destroy(%struct.Person* %4)
ret i32 0
}