#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*/ gets(char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ scanf(char *, char **);
int main() {
  char prompt[] = "Please enter your first name:";
  char prompt2[] = "Now, what is your last name?";
  char gratis[] = "Thanks!";
  char first[25];
  char last[20];
  printf(prompt);
  gets(first);
  printf(prompt2);
  scanf("%s", &last);
  puts(gratis);
  printf("\nPleased to meet you, %s %s\a!", first, last);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xea7(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xea4(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xea1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xe9f(%rip),%eax
mov    %eax,-0x18(%rbp)
mov    0xe99(%rip),%ax
mov    %ax,-0x14(%rbp)
mov    0xe92(%rip),%rax
mov    %rax,-0x50(%rbp)
mov    0xe8f(%rip),%rax
mov    %rax,-0x48(%rbp)
mov    0xe8c(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0xe8a(%rip),%eax
mov    %eax,-0x38(%rbp)
mov    0xe85(%rip),%al
mov    %al,-0x34(%rbp)
mov    0xe7c(%rip),%rax
mov    %rax,-0x58(%rbp)
lea    -0x30(%rbp),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x80(%rbp),%rdi
call   1050 <gets@plt>
lea    -0x50(%rbp),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0xa0(%rbp),%rsi
lea    0xe53(%rip),%rdi
call   1060 <scanf@plt>
lea    -0x58(%rbp),%rdi
call   1030 <puts@plt>
lea    -0x80(%rbp),%rsi
lea    -0xa0(%rbp),%rdx
lea    0xe36(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x98,%rsp
movups 0xebd(%rip),%xmm0
movups %xmm0,0x3e(%rsp)
movaps 0xea3(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movups 0xec4(%rip),%xmm0
movups %xmm0,0x1d(%rsp)
movaps 0xeab(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movabs $0x21736b6e616854,%rax
mov    %rax,0x8(%rsp)
lea    0x30(%rsp),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x70(%rsp),%r14
mov    %r14,%rdi
call   1050 <gets@plt>
lea    0x10(%rsp),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe88(%rip),%rdi
lea    0x50(%rsp),%rbx
mov    %rbx,%rsi
call   1060 <scanf@plt>
lea    0x8(%rsp),%rdi
call   1030 <puts@plt>
lea    0xe6d(%rip),%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x98,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.main.prompt = [30 x i8] c"Please enter your first name:\00"
@__const.main.prompt2 = [29 x i8] c"Now, what is your last name?\00"
@__const.main.gratis = [8 x i8] c"Thanks!\00"
@.str = [3 x i8] c"%s\00"
@.str.1 = [30 x i8] c"\0APleased to meet you, %s %s\07!\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [30 x i8]
%3 = alloca [29 x i8]
%4 = alloca [8 x i8]
%5 = alloca [25 x i8]
%6 = alloca [20 x i8]
store i32 0, i32* %1
%7 = bitcast [30 x i8]* %2 to i8*
%8 = bitcast [29 x i8]* %3 to i8*
%9 = bitcast [8 x i8]* %4 to i8*
%10 = getelementptr inbounds [30 x i8], [30 x i8]* %2, i64 0, i64 0
%11 = call i32 (i8*, ...) @printf(i8* %10)
%12 = getelementptr inbounds [25 x i8], [25 x i8]* %5, i64 0, i64 0
%13 = call i32 @gets(i8* %12)
%14 = getelementptr inbounds [29 x i8], [29 x i8]* %3, i64 0, i64 0
%15 = call i32 (i8*, ...) @printf(i8* %14)
%16 = bitcast [20 x i8]* %6 to i8**
%17 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %16)
%18 = getelementptr inbounds [8 x i8], [8 x i8]* %4, i64 0, i64 0
%19 = call i32 @puts(i8* %18)
%20 = getelementptr inbounds [25 x i8], [25 x i8]* %5, i64 0, i64 0
%21 = getelementptr inbounds [20 x i8], [20 x i8]* %6, i64 0, i64 0
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* %20, i8* %21)
ret i32 0
}

LLVM IR (-O2):
@__const.main.prompt = [30 x i8] c"Please enter your first name:\00"
@__const.main.prompt2 = [29 x i8] c"Now, what is your last name?\00"
@.str = [3 x i8] c"%s\00"
@.str.1 = [30 x i8] c"\0APleased to meet you, %s %s\07!\00"
define i32 @main() {
%1 = alloca [30 x i8]
%2 = alloca [29 x i8]
%3 = alloca i64
%4 = alloca [25 x i8]
%5 = alloca [20 x i8]
%6 = getelementptr inbounds [30 x i8], [30 x i8]* %1, i64 0, i64 0
%7 = getelementptr inbounds [29 x i8], [29 x i8]* %2, i64 0, i64 0
%8 = bitcast i64* %3 to i8*
store i64 9415579482024020, i64* %3
%9 = getelementptr inbounds [25 x i8], [25 x i8]* %4, i64 0, i64 0
%10 = getelementptr inbounds [20 x i8], [20 x i8]* %5, i64 0, i64 0
%11 = call i32 (i8*, ...) @printf(i8* %6)
%12 = call i32 @gets(i8* %9)
%13 = call i32 (i8*, ...) @printf(i8* %7)
%14 = bitcast [20 x i8]* %5 to i8**
%15 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %14)
%16 = call i32 @puts(i8* %8)
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* %9, i8* %10)
ret i32 0
}