#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*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int /*<<< orphan*/ system(char *);
void shell(char **suboptionpp, int *i, int *Item_Ptr, char *subwrdptr,
           int *subnext, char **wrdpp, double vals[], int nwrd, int *N_Cntr) {
  char shcmd[100];
  *subnext = 1;
  strcpy(shcmd, " ");
  while (*subnext) {
    if ((*i) + 1 == nwrd)
      break;
    (*i)++;
    Item_Ptr++;
    strcat(shcmd, wrdpp[(*i)]);
    strcat(shcmd, " ");
  }
  system(shcmd);
}


x86 assembly (clang, -O0):
<shell>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x28(%rbp),%rax
movl   $0x1,(%rax)
lea    -0xa0(%rbp),%rdi
lea    0xe8a(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x28(%rbp),%rax
cmpl   $0x0,(%rax)
je     11e9 <shell+0xb9>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
add    $0x1,%eax
cmp    0x18(%rbp),%eax
jne    119f <shell+0x6f>
jmp    11e9 <shell+0xb9>
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x18(%rbp)
lea    -0xa0(%rbp),%rdi
mov    -0x30(%rbp),%rax
mov    -0x10(%rbp),%rcx
movslq (%rcx),%rcx
mov    (%rax,%rcx,8),%rsi
call   1050 <strcat@plt>
lea    -0xa0(%rbp),%rdi
lea    0xe21(%rip),%rsi
call   1050 <strcat@plt>
jmp    117b <shell+0x4b>
lea    -0xa0(%rbp),%rdi
call   1040 <system@plt>
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shell>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x68,%rsp
mov    %r9,%r14
mov    %r8,%r15
mov    %rsi,%rbx
movl   $0x1,(%r8)
lea    0xeab(%rip),%rsi
mov    %rsp,%rdi
call   1030 <strcpy@plt>
cmpl   $0x0,(%r15)
je     11aa <shell+0x7a>
mov    0xa8(%rsp),%ebp
mov    %rsp,%r12
lea    0xe8c(%rip),%r13
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movslq (%rbx),%rax
lea    0x1(%rax),%ecx
cmp    %ebp,%ecx
je     11aa <shell+0x7a>
mov    %ecx,(%rbx)
mov    0x8(%r14,%rax,8),%rsi
mov    %r12,%rdi
call   1050 <strcat@plt>
mov    %r12,%rdi
mov    %r13,%rsi
call   1050 <strcat@plt>
cmpl   $0x0,(%r15)
jne    1180 <shell+0x50>
mov    %rsp,%rdi
call   1040 <system@plt>
add    $0x68,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c" \00"
define void @shell(i8** %0, i32* %1, i32* %2, i8* %3, i32* %4, i8** %5, double* %6, i32 %7, i32* %8) {
%10 = alloca i8**
%11 = alloca i32*
%12 = alloca i32*
%13 = alloca i8*
%14 = alloca i32*
%15 = alloca i8**
%16 = alloca double*
%17 = alloca i32
%18 = alloca i32*
%19 = alloca [100 x i8]
store i8** %0, i8*** %10
store i32* %1, i32** %11
store i32* %2, i32** %12
store i8* %3, i8** %13
store i32* %4, i32** %14
store i8** %5, i8*** %15
store double* %6, double** %16
store i32 %7, i32* %17
store i32* %8, i32** %18
%20 = load i32*, i32** %14
store i32 1, i32* %20
%21 = getelementptr inbounds [100 x i8], [100 x i8]* %19, i64 0, i64 0
%22 = call i32 @strcpy(i8* %21, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %23
23: ; preds = %34, %9
%24 = load i32*, i32** %14
%25 = load i32, i32* %24
%26 = icmp ne i32 %25, 0
br i1 %26, label %27, label %50
27: ; preds = %23
%28 = load i32*, i32** %11
%29 = load i32, i32* %28
%30 = add nsw i32 %29, 1
%31 = load i32, i32* %17
%32 = icmp eq i32 %30, %31
br i1 %32, label %33, label %34
33: ; preds = %27
br label %50
34: ; preds = %27
%35 = load i32*, i32** %11
%36 = load i32, i32* %35
%37 = add nsw i32 %36, 1
store i32 %37, i32* %35
%38 = load i32*, i32** %12
%39 = getelementptr inbounds i32, i32* %38, i32 1
store i32* %39, i32** %12
%40 = getelementptr inbounds [100 x i8], [100 x i8]* %19, i64 0, i64 0
%41 = load i8**, i8*** %15
%42 = load i32*, i32** %11
%43 = load i32, i32* %42
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds i8*, i8** %41, i64 %44
%46 = load i8*, i8** %45
%47 = call i32 @strcat(i8* %40, i8* %46)
%48 = getelementptr inbounds [100 x i8], [100 x i8]* %19, i64 0, i64 0
%49 = call i32 @strcat(i8* %48, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %23
50: ; preds = %33, %23
%51 = getelementptr inbounds [100 x i8], [100 x i8]* %19, i64 0, i64 0
%52 = call i32 @system(i8* %51)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c" \00"
define void @shell(i8** nocapture readnone %0, i32* nocapture %1, i32* nocapture readnone %2, i8* nocapture readnone %3, i32* nocapture %4, i8** nocapture %5, double* nocapture readnone %6, i32 %7, i32* nocapture readnone %8) {
%10 = alloca [100 x i8]
%11 = getelementptr inbounds [100 x i8], [100 x i8]* %10, i64 0, i64 0
store i32 1, i32* %4
%12 = call i32 @strcpy(i8* %11, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%13 = load i32, i32* %4
%14 = icmp eq i32 %13, 0
br i1 %14, label %27, label %15
15: ; preds = %9, %19
%16 = load i32, i32* %1
%17 = add nsw i32 %16, 1
%18 = icmp eq i32 %17, %7
br i1 %18, label %27, label %19
19: ; preds = %15
store i32 %17, i32* %1
%20 = sext i32 %17 to i64
%21 = getelementptr inbounds i8*, i8** %5, i64 %20
%22 = load i8*, i8** %21
%23 = call i32 @strcat(i8* %11, i8* %22)
%24 = call i32 @strcat(i8* %11, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%25 = load i32, i32* %4
%26 = icmp eq i32 %25, 0
br i1 %26, label %27, label %15
27: ; preds = %19, %15, %9
%28 = call i32 @system(i8* %11)
ret void
}