#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*/ free(char *);
char *getAmt();
char *getCC();
char *getEmail();
char *getExpr();
char *getName();
char *getZip();
int /*<<< orphan*/ printf(char *, char *);
int main(void) {
  char *name = getName();
  char *cc = getCC();
  char *expr = getExpr();
  char *zip = getZip();
  char *amt = getAmt();
  char *email = getEmail();
  printf("\nName: %s\n", name);
  printf("Credit card number: %s\n", cc);
  printf("Expiration month and year: %s\n", expr);
  printf("Zip Code: %s\n", zip);
  printf("Purchase Amount: %s\n", amt);
  printf("Email Address: %s\n", email);
  if (cc != NULL)
    free(cc);
  if (name != NULL)
    free(name);
  if (expr != NULL)
    free(expr);
  if (zip != NULL)
    free(zip);
  if (amt != NULL)
    free(amt);
  if (email != NULL)
    free(email);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1090 <getName@plt>
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1050 <getCC@plt>
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   10a0 <getExpr@plt>
mov    %rax,-0x20(%rbp)
mov    $0x0,%al
call   1040 <getZip@plt>
mov    %rax,-0x28(%rbp)
mov    $0x0,%al
call   1080 <getAmt@plt>
mov    %rax,-0x30(%rbp)
mov    $0x0,%al
call   1070 <getEmail@plt>
mov    %rax,-0x38(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xe24(%rip),%rdi
call   1060 <printf@plt>
mov    -0x18(%rbp),%rsi
lea    0xe1f(%rip),%rdi
call   1060 <printf@plt>
mov    -0x20(%rbp),%rsi
lea    0xe27(%rip),%rdi
call   1060 <printf@plt>
mov    -0x28(%rbp),%rsi
lea    0xe36(%rip),%rdi
call   1060 <printf@plt>
mov    -0x30(%rbp),%rsi
lea    0xe34(%rip),%rdi
call   1060 <printf@plt>
mov    -0x38(%rbp),%rsi
lea    0xe39(%rip),%rdi
call   1060 <printf@plt>
cmpq   $0x0,-0x18(%rbp)
je     1245 <main+0xc5>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
cmpq   $0x0,-0x10(%rbp)
je     1259 <main+0xd9>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
cmpq   $0x0,-0x20(%rbp)
je     126d <main+0xed>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
cmpq   $0x0,-0x28(%rbp)
je     1281 <main+0x101>
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
cmpq   $0x0,-0x30(%rbp)
je     1295 <main+0x115>
mov    -0x30(%rbp),%rdi
call   1030 <free@plt>
cmpq   $0x0,-0x38(%rbp)
je     12a9 <main+0x129>
mov    -0x38(%rbp),%rdi
call   1030 <free@plt>
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
xor    %eax,%eax
call   1090 <getName@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1050 <getCC@plt>
mov    %rax,%rbp
xor    %eax,%eax
call   10a0 <getExpr@plt>
mov    %rax,%r13
xor    %eax,%eax
call   1040 <getZip@plt>
mov    %rax,%r12
xor    %eax,%eax
call   1080 <getAmt@plt>
mov    %rax,%r15
xor    %eax,%eax
call   1070 <getEmail@plt>
mov    %rax,%r14
lea    0xe32(%rip),%rdi
mov    %rbx,%rsi
call   1060 <printf@plt>
lea    0xe2e(%rip),%rdi
mov    %rbp,%rsi
call   1060 <printf@plt>
lea    0xe37(%rip),%rdi
mov    %r13,%rsi
call   1060 <printf@plt>
lea    0xe47(%rip),%rdi
mov    %r12,%rsi
call   1060 <printf@plt>
lea    0xe46(%rip),%rdi
mov    %r15,%rsi
call   1060 <printf@plt>
lea    0xe4c(%rip),%rdi
mov    %r14,%rsi
call   1060 <printf@plt>
test   %rbp,%rbp
je     122e <main+0xae>
mov    %rbp,%rdi
call   1030 <free@plt>
test   %rbx,%rbx
je     123b <main+0xbb>
mov    %rbx,%rdi
call   1030 <free@plt>
test   %r13,%r13
je     1248 <main+0xc8>
mov    %r13,%rdi
call   1030 <free@plt>
test   %r12,%r12
je     1255 <main+0xd5>
mov    %r12,%rdi
call   1030 <free@plt>
test   %r15,%r15
je     1262 <main+0xe2>
mov    %r15,%rdi
call   1030 <free@plt>
test   %r14,%r14
je     126f <main+0xef>
mov    %r14,%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [11 x i8] c"\0AName: %s\0A\00"
@.str.1 = [24 x i8] c"Credit card number: %s\0A\00"
@.str.2 = [31 x i8] c"Expiration month and year: %s\0A\00"
@.str.3 = [14 x i8] c"Zip Code: %s\0A\00"
@.str.4 = [21 x i8] c"Purchase Amount: %s\0A\00"
@.str.5 = [19 x i8] c"Email Address: %s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
store i32 0, i32* %1
%8 = call i8* (...) @getName()
store i8* %8, i8** %2
%9 = call i8* (...) @getCC()
store i8* %9, i8** %3
%10 = call i8* (...) @getExpr()
store i8* %10, i8** %4
%11 = call i8* (...) @getZip()
store i8* %11, i8** %5
%12 = call i8* (...) @getAmt()
store i8* %12, i8** %6
%13 = call i8* (...) @getEmail()
store i8* %13, i8** %7
%14 = load i8*, i8** %2
%15 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %14)
%16 = load i8*, i8** %3
%17 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i8* %16)
%18 = load i8*, i8** %4
%19 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), i8* %18)
%20 = load i8*, i8** %5
%21 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i8* %20)
%22 = load i8*, i8** %6
%23 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.4, i64 0, i64 0), i8* %22)
%24 = load i8*, i8** %7
%25 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0), i8* %24)
%26 = load i8*, i8** %3
%27 = icmp ne i8* %26, null
br i1 %27, label %28, label %31
28: ; preds = %0
%29 = load i8*, i8** %3
%30 = call i32 @free(i8* %29)
br label %31
31: ; preds = %28, %0
%32 = load i8*, i8** %2
%33 = icmp ne i8* %32, null
br i1 %33, label %34, label %37
34: ; preds = %31
%35 = load i8*, i8** %2
%36 = call i32 @free(i8* %35)
br label %37
37: ; preds = %34, %31
%38 = load i8*, i8** %4
%39 = icmp ne i8* %38, null
br i1 %39, label %40, label %43
40: ; preds = %37
%41 = load i8*, i8** %4
%42 = call i32 @free(i8* %41)
br label %43
43: ; preds = %40, %37
%44 = load i8*, i8** %5
%45 = icmp ne i8* %44, null
br i1 %45, label %46, label %49
46: ; preds = %43
%47 = load i8*, i8** %5
%48 = call i32 @free(i8* %47)
br label %49
49: ; preds = %46, %43
%50 = load i8*, i8** %6
%51 = icmp ne i8* %50, null
br i1 %51, label %52, label %55
52: ; preds = %49
%53 = load i8*, i8** %6
%54 = call i32 @free(i8* %53)
br label %55
55: ; preds = %52, %49
%56 = load i8*, i8** %7
%57 = icmp ne i8* %56, null
br i1 %57, label %58, label %61
58: ; preds = %55
%59 = load i8*, i8** %7
%60 = call i32 @free(i8* %59)
br label %61
61: ; preds = %58, %55
%62 = load i32, i32* %1
ret i32 %62
}

LLVM IR (-O2):
@.str = [11 x i8] c"\0AName: %s\0A\00"
@.str.1 = [24 x i8] c"Credit card number: %s\0A\00"
@.str.2 = [31 x i8] c"Expiration month and year: %s\0A\00"
@.str.3 = [14 x i8] c"Zip Code: %s\0A\00"
@.str.4 = [21 x i8] c"Purchase Amount: %s\0A\00"
@.str.5 = [19 x i8] c"Email Address: %s\0A\00"
define i32 @main() {
%1 = tail call i8* (...) @getName()
%2 = tail call i8* (...) @getCC()
%3 = tail call i8* (...) @getExpr()
%4 = tail call i8* (...) @getZip()
%5 = tail call i8* (...) @getAmt()
%6 = tail call i8* (...) @getEmail()
%7 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %1)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%9 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), i8* %3)
%10 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i8* %4)
%11 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.4, i64 0, i64 0), i8* %5)
%12 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0), i8* %6)
%13 = icmp eq i8* %2, null
br i1 %13, label %16, label %14
14: ; preds = %0
%15 = tail call i32 @free(i8* %2)
br label %16
16: ; preds = %14, %0
%17 = icmp eq i8* %1, null
br i1 %17, label %20, label %18
18: ; preds = %16
%19 = tail call i32 @free(i8* %1)
br label %20
20: ; preds = %18, %16
%21 = icmp eq i8* %3, null
br i1 %21, label %24, label %22
22: ; preds = %20
%23 = tail call i32 @free(i8* %3)
br label %24
24: ; preds = %22, %20
%25 = icmp eq i8* %4, null
br i1 %25, label %28, label %26
26: ; preds = %24
%27 = tail call i32 @free(i8* %4)
br label %28
28: ; preds = %26, %24
%29 = icmp eq i8* %5, null
br i1 %29, label %32, label %30
30: ; preds = %28
%31 = tail call i32 @free(i8* %5)
br label %32
32: ; preds = %30, %28
%33 = icmp eq i8* %6, null
br i1 %33, label %36, label %34
34: ; preds = %32
%35 = tail call i32 @free(i8* %6)
br label %36
36: ; preds = %34, %32
ret i32 0
}