#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*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int /*<<< orphan*/ system(char *);
int main() {
  char name[64];
  char command[64];
  printf("Please enter your name: ");
  gets(name);
  strcpy(command, "beta \"");
  strcat(command, name);
  strcat(command, "\"");
  system(command);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe97(%rip),%rdi
call   1050 <printf@plt>
lea    -0x50(%rbp),%rdi
call   1060 <gets@plt>
lea    -0x90(%rbp),%rdi
lea    0xe94(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x90(%rbp),%rdi
lea    -0x50(%rbp),%rsi
call   1070 <strcat@plt>
lea    -0x90(%rbp),%rdi
lea    0xe76(%rip),%rsi
call   1070 <strcat@plt>
lea    -0x90(%rbp),%rdi
call   1040 <system@plt>
xor    %eax,%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x88,%rsp
lea    0xe9f(%rip),%rdi
call   1050 <printf@plt>
lea    0x40(%rsp),%r14
mov    %r14,%rdi
call   1060 <gets@plt>
lea    0xe9f(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1070 <strcat@plt>
lea    0xe87(%rip),%rsi
mov    %rbx,%rdi
call   1070 <strcat@plt>
mov    %rbx,%rdi
call   1040 <system@plt>
xor    %eax,%eax
add    $0x88,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [25 x i8] c"Please enter your name: \00"
@.str.1 = [7 x i8] c"beta \22\00"
@.str.2 = [2 x i8] c"\22\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [64 x i8]
%3 = alloca [64 x i8]
store i32 0, i32* %1
%4 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%5 = getelementptr inbounds [64 x i8], [64 x i8]* %2, i64 0, i64 0
%6 = call i32 @gets(i8* %5)
%7 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%8 = call i32 @strcpy(i8* %7, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%9 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%10 = getelementptr inbounds [64 x i8], [64 x i8]* %2, i64 0, i64 0
%11 = call i32 @strcat(i8* %9, i8* %10)
%12 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%13 = call i32 @strcat(i8* %12, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%14 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%15 = call i32 @system(i8* %14)
ret i32 0
}

LLVM IR (-O2):
@.str = [25 x i8] c"Please enter your name: \00"
@.str.1 = [7 x i8] c"beta \22\00"
@.str.2 = [2 x i8] c"\22\00"
define i32 @main() {
%1 = alloca [64 x i8]
%2 = alloca [64 x i8]
%3 = getelementptr inbounds [64 x i8], [64 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [64 x i8], [64 x i8]* %2, i64 0, i64 0
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @gets(i8* %3)
%7 = call i32 @strcpy(i8* %4, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 @strcat(i8* %4, i8* %3)
%9 = call i32 @strcat(i8* %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%10 = call i32 @system(i8* %4)
ret i32 0
}