#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*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ strcpy(char *, char *);
int /*<<< orphan*/ system(char *);
int main() {
  char str[10];
  fprintf(stdout, "DATE:\n");
  system("date");
  fprintf(stdout, "LS:\n");
  system("ls");
  fprintf(stdout, "LS -LAR:\n");
  strcpy(str, "ls -laR .");
  system(str);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2e8a(%rip),%rax
mov    (%rax),%edi
lea    0xea1(%rip),%rsi
call   1050 <fprintf@plt>
lea    0xe9c(%rip),%rdi
call   1040 <system@plt>
mov    0x2e69(%rip),%rax
mov    (%rax),%edi
lea    0xe8c(%rip),%rsi
call   1050 <fprintf@plt>
lea    0xe85(%rip),%rdi
call   1040 <system@plt>
mov    0x2e48(%rip),%rax
mov    (%rax),%edi
lea    0xe73(%rip),%rsi
call   1050 <fprintf@plt>
lea    -0xe(%rbp),%rdi
lea    0xe6d(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0xe(%rbp),%rdi
call   1040 <system@plt>
xor    %edi,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
mov    0x2e94(%rip),%rbx
mov    (%rbx),%edi
lea    0xeab(%rip),%rsi
call   1050 <fprintf@plt>
lea    0xea6(%rip),%rdi
call   1040 <system@plt>
mov    (%rbx),%edi
lea    0xe9d(%rip),%rsi
call   1050 <fprintf@plt>
lea    0xe96(%rip),%rdi
call   1040 <system@plt>
mov    (%rbx),%edi
lea    0xe8b(%rip),%rsi
call   1050 <fprintf@plt>
lea    0xe89(%rip),%rsi
lea    0x6(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
call   1040 <system@plt>
xor    %edi,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [7 x i8] c"DATE:\0A\00"
@.str.1 = [5 x i8] c"date\00"
@.str.2 = [5 x i8] c"LS:\0A\00"
@.str.3 = [3 x i8] c"ls\00"
@.str.4 = [10 x i8] c"LS -LAR:\0A\00"
@.str.5 = [10 x i8] c"ls -laR .\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i8]
store i32 0, i32* %1
%3 = load i32, i32* @stdout
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @system(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%6 = load i32, i32* @stdout
%7 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%8 = call i32 @system(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%9 = load i32, i32* @stdout
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0))
%11 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%12 = call i32 @strcpy(i8* %11, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0))
%13 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%14 = call i32 @system(i8* %13)
%15 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [7 x i8] c"DATE:\0A\00"
@.str.1 = [5 x i8] c"date\00"
@.str.2 = [5 x i8] c"LS:\0A\00"
@.str.3 = [3 x i8] c"ls\00"
@.str.4 = [10 x i8] c"LS -LAR:\0A\00"
@.str.5 = [10 x i8] c"ls -laR .\00"
define i32 @main() {
%1 = alloca [10 x i8]
%2 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%3 = load i32, i32* @stdout
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @system(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%6 = load i32, i32* @stdout
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%8 = tail call i32 @system(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%9 = load i32, i32* @stdout
%10 = tail call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0))
%11 = call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0))
%12 = call i32 @system(i8* %2)
%13 = call i32 @exit(i32 0)
unreachable
}