#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 *, char *, char *, char *);
int /*<<< orphan*/ puts(char *);
int main() {
  char prenume[20];
  char preprenume[20];
  char nume[3];
  puts("  What's your name?");
  gets(prenume);
  puts("\n  That is not your full name..., is it?");
  puts("  What's your other name?");
  gets(preprenume);
  puts("\n  And your last name!\n    Do I have to guess?");
  gets(nume);
  printf("\n\n   Nice to meet you %s %s-%s !\n", nume, preprenume, prenume);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1030 <puts@plt>
lea    -0x20(%rbp),%rdi
call   1050 <gets@plt>
lea    0xeb9(%rip),%rdi
call   1030 <puts@plt>
lea    0xed6(%rip),%rdi
call   1030 <puts@plt>
lea    -0x40(%rbp),%rdi
call   1050 <gets@plt>
lea    0xedb(%rip),%rdi
call   1030 <puts@plt>
lea    -0x43(%rbp),%rdi
call   1050 <gets@plt>
lea    -0x43(%rbp),%rsi
lea    -0x40(%rbp),%rdx
lea    -0x20(%rbp),%rcx
lea    0xee9(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x50,%rsp
lea    0xec0(%rip),%rdi
call   1030 <puts@plt>
lea    0x30(%rsp),%r14
mov    %r14,%rdi
call   1050 <gets@plt>
lea    0xebb(%rip),%rdi
call   1030 <puts@plt>
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
lea    0x10(%rsp),%r15
mov    %r15,%rdi
call   1050 <gets@plt>
lea    0xed9(%rip),%rdi
call   1030 <puts@plt>
lea    0xd(%rsp),%rbx
mov    %rbx,%rdi
call   1050 <gets@plt>
lea    0xeef(%rip),%rdi
mov    %rbx,%rsi
mov    %r15,%rdx
mov    %r14,%rcx
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [20 x i8] c" What's your name?\00"
@.str.1 = [41 x i8] c"\0A That is not your full name..., is it?\00"
@.str.2 = [26 x i8] c" What's your other name?\00"
@.str.3 = [47 x i8] c"\0A And your last name!\0A Do I have to guess?\00"
@.str.4 = [34 x i8] c"\0A\0A Nice to meet you %s %s-%s !\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [20 x i8]
%3 = alloca [20 x i8]
%4 = alloca [3 x i8]
store i32 0, i32* %1
%5 = call i32 @puts(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%6 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%7 = call i32 @gets(i8* %6)
%8 = call i32 @puts(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0))
%9 = call i32 @puts(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0))
%10 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%11 = call i32 @gets(i8* %10)
%12 = call i32 @puts(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.3, i64 0, i64 0))
%13 = getelementptr inbounds [3 x i8], [3 x i8]* %4, i64 0, i64 0
%14 = call i32 @gets(i8* %13)
%15 = getelementptr inbounds [3 x i8], [3 x i8]* %4, i64 0, i64 0
%16 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%17 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%18 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.4, i64 0, i64 0), i8* %15, i8* %16, i8* %17)
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c" What's your name?\00"
@.str.1 = [41 x i8] c"\0A That is not your full name..., is it?\00"
@.str.2 = [26 x i8] c" What's your other name?\00"
@.str.3 = [47 x i8] c"\0A And your last name!\0A Do I have to guess?\00"
@.str.4 = [34 x i8] c"\0A\0A Nice to meet you %s %s-%s !\0A\00"
define i32 @main() {
%1 = alloca [20 x i8]
%2 = alloca [20 x i8]
%3 = alloca [3 x i8]
%4 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%5 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%6 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 0
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @gets(i8* %4)
%9 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0))
%10 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0))
%11 = call i32 @gets(i8* %5)
%12 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @.str.3, i64 0, i64 0))
%13 = call i32 @gets(i8* %6)
%14 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.4, i64 0, i64 0), i8* %6, i8* %5, i8* %4)
ret i32 0
}