#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*/ getchar();
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ putchar(char);
int /*<<< orphan*/ puts(char *);
void name_2(void) {
  char name[30];
  char *n = name;
  int x = 0;
  printf("Please enter your name here %c ", 16);
  gets(name);
  printf("\nSo your name is ");
  puts(n);
  putchar('?');
  putchar(' ');
  getchar();
  puts("\nOkey...");
}


x86 assembly (clang, -O0):
<name_2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
lea    0xe92(%rip),%rdi
mov    $0x10,%esi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x20(%rbp),%rdi
call   1070 <gets@plt>
lea    0xe96(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x28(%rbp),%rdi
call   1040 <puts@plt>
mov    $0x3f,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    $0x0,%al
call   1060 <getchar@plt>
lea    0xe76(%rip),%rdi
call   1040 <puts@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<name_2>:
push   %rbx
sub    $0x20,%rsp
lea    0xea4(%rip),%rdi
mov    $0x10,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1070 <gets@plt>
lea    0xea6(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
call   1040 <puts@plt>
mov    $0x3f,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1060 <getchar@plt>
lea    0xe87(%rip),%rdi
call   1040 <puts@plt>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [32 x i8] c"Please enter your name here %c \00"
@.str.1 = [18 x i8] c"\0ASo your name is \00"
@.str.2 = [9 x i8] c"\0AOkey...\00"
define void @name_2() {
%1 = alloca [30 x i8]
%2 = alloca i8*
%3 = alloca i32
%4 = getelementptr inbounds [30 x i8], [30 x i8]* %1, i64 0, i64 0
store i8* %4, i8** %2
store i32 0, i32* %3
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 16)
%6 = getelementptr inbounds [30 x i8], [30 x i8]* %1, i64 0, i64 0
%7 = call i32 @gets(i8* %6)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
%9 = load i8*, i8** %2
%10 = call i32 @puts(i8* %9)
%11 = call i32 @putchar(i8 signext 63)
%12 = call i32 @putchar(i8 signext 32)
%13 = call i32 (...) @getchar()
%14 = call i32 @puts(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [32 x i8] c"Please enter your name here %c \00"
@.str.1 = [18 x i8] c"\0ASo your name is \00"
@.str.2 = [9 x i8] c"\0AOkey...\00"
define void @name_2() {
%1 = alloca [30 x i8]
%2 = getelementptr inbounds [30 x i8], [30 x i8]* %1, i64 0, i64 0
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 16)
%4 = call i32 @gets(i8* %2)
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @puts(i8* %2)
%7 = call i32 @putchar(i8 signext 63)
%8 = call i32 @putchar(i8 signext 32)
%9 = call i32 (...) @getchar()
%10 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
ret void
}