#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*/ printf(char *);
int /*<<< orphan*/ scanf(char *, char *);
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ system(char *);
int CORE_CMD_APP() {
  char an[100];
  char path[100] = "./apps/";
  printf("APP NAME>* ");
  scanf("%s", an);
  strcat(path, an);
  system(path);
}


x86 assembly (clang, -O0):
<CORE_CMD_APP>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
lea    -0xe0(%rbp),%rdi
lea    0xe97(%rip),%rsi
mov    $0x64,%edx
call   1050 <memcpy@plt>
lea    0xeea(%rip),%rdi
call   1040 <printf@plt>
lea    -0x70(%rbp),%rsi
lea    0xee6(%rip),%rdi
call   1060 <scanf@plt>
lea    -0xe0(%rbp),%rdi
lea    -0x70(%rbp),%rsi
call   1070 <strcat@plt>
lea    -0xe0(%rbp),%rdi
call   1030 <system@plt>
mov    -0x4(%rbp),%eax
add    $0xe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CORE_CMD_APP>:
push   %r14
push   %rbx
sub    $0xd8,%rsp
movaps 0xeff(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps 0xee3(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xec7(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xeab(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xe8f(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xe73(%rip),%xmm0
movaps %xmm0,(%rsp)
movl   $0x0,0x60(%rsp)
lea    0xec4(%rip),%rdi
call   1040 <printf@plt>
lea    0xec4(%rip),%rdi
lea    0x70(%rsp),%r14
mov    %r14,%rsi
call   1050 <scanf@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1060 <strcat@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
add    $0xd8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.CORE_CMD_APP.path = [100 x i8] c"./apps/\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@.str = [12 x i8] c"APP NAME>* \00"
@.str.1 = [3 x i8] c"%s\00"
define i32 @CORE_CMD_APP() {
%1 = alloca i32
%2 = alloca [100 x i8]
%3 = alloca [100 x i8]
%4 = bitcast [100 x i8]* %3 to i8*
%5 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %6)
%8 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%9 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%10 = call i32 @strcat(i8* %8, i8* %9)
%11 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%12 = call i32 @system(i8* %11)
%13 = load i32, i32* %1
ret i32 %13
}

LLVM IR (-O2):
@__const.CORE_CMD_APP.path = [100 x i8] c"./apps/\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@.str = [12 x i8] c"APP NAME>* \00"
@.str.1 = [3 x i8] c"%s\00"
define i32 @CORE_CMD_APP() {
%1 = alloca [100 x i8]
%2 = alloca [100 x i8]
%3 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%7 = call i32 @strcat(i8* %4, i8* %3)
%8 = call i32 @system(i8* %4)
ret i32 undef
}