#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*/ system(char *);
int main() {
  char fullpathhostname[] = "/usr/bin/host www.cs.purdue.edu";
  system("/usr/bin/host www.cs.purdue.edu");
  system("/usr/bin/host www.cs.purdue.edu");
  system(fullpathhostname);
  fullpathhostname[0] = 'l';
  fullpathhostname[1] = 's';
  fullpathhostname[2] = ' ';
  fullpathhostname[3] = '-';
  fullpathhostname[4] = 'l';
  fullpathhostname[5] = '\0';
  system(fullpathhostname);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xee1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xede(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xedb(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xed8(%rip),%rax
mov    %rax,-0x8(%rbp)
lea    0xed5(%rip),%rdi
call   1030 <system@plt>
lea    0xec9(%rip),%rdi
call   1030 <system@plt>
lea    -0x20(%rbp),%rdi
call   1030 <system@plt>
movb   $0x6c,-0x20(%rbp)
movb   $0x73,-0x1f(%rbp)
movb   $0x20,-0x1e(%rbp)
movb   $0x2d,-0x1d(%rbp)
movb   $0x6c,-0x1c(%rbp)
movb   $0x0,-0x1b(%rbp)
lea    -0x20(%rbp),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
movaps 0xef4(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xed8(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0xecd(%rip),%rbx
mov    %rbx,%rdi
call   1030 <system@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <system@plt>
movl   $0x2d20736c,(%rsp)
movw   $0x6c,0x4(%rsp)
mov    %rbx,%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.fullpathhostname = [32 x i8] c"/usr/bin/host www.cs.purdue.edu\00"
@.str = [32 x i8] c"/usr/bin/host www.cs.purdue.edu\00"
define i32 @main() {
%1 = alloca [32 x i8]
%2 = bitcast [32 x i8]* %1 to i8*
%3 = call i32 @system(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @system(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%5 = getelementptr inbounds [32 x i8], [32 x i8]* %1, i64 0, i64 0
%6 = call i32 @system(i8* %5)
%7 = getelementptr inbounds [32 x i8], [32 x i8]* %1, i64 0, i64 0
store i8 108, i8* %7
%8 = getelementptr inbounds [32 x i8], [32 x i8]* %1, i64 0, i64 1
store i8 115, i8* %8
%9 = getelementptr inbounds [32 x i8], [32 x i8]* %1, i64 0, i64 2
store i8 32, i8* %9
%10 = getelementptr inbounds [32 x i8], [32 x i8]* %1, i64 0, i64 3
store i8 45, i8* %10
%11 = getelementptr inbounds [32 x i8], [32 x i8]* %1, i64 0, i64 4
store i8 108, i8* %11
%12 = getelementptr inbounds [32 x i8], [32 x i8]* %1, i64 0, i64 5
store i8 0, i8* %12
%13 = getelementptr inbounds [32 x i8], [32 x i8]* %1, i64 0, i64 0
%14 = call i32 @system(i8* %13)
ret i32 0
}

LLVM IR (-O2):
@.str = [32 x i8] c"/usr/bin/host www.cs.purdue.edu\00"
define i32 @main() {
%1 = alloca [32 x i8]
%2 = getelementptr inbounds [32 x i8], [32 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @system(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @system(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @system(i8* %2)
store i8 108, i8* %2
%6 = getelementptr inbounds [32 x i8], [32 x i8]* %1, i64 0, i64 1
store i8 115, i8* %6
%7 = getelementptr inbounds [32 x i8], [32 x i8]* %1, i64 0, i64 2
store i8 32, i8* %7
%8 = getelementptr inbounds [32 x i8], [32 x i8]* %1, i64 0, i64 3
store i8 45, i8* %8
%9 = getelementptr inbounds [32 x i8], [32 x i8]* %1, i64 0, i64 4
store i8 108, i8* %9
%10 = getelementptr inbounds [32 x i8], [32 x i8]* %1, i64 0, i64 5
store i8 0, i8* %10
%11 = call i32 @system(i8* %2)
ret i32 0
}