#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 */
struct priv_usch_stash_item {
  int dummy;
};

/* Variables and functions */
int priv_usch_command(char const **, int, int, int, int *,
                      struct priv_usch_stash_item **);
int priv_usch_run(const char **pp_argv, int input, int first, int last,
                  int *p_child_pid, struct priv_usch_stash_item **pp_out,
                  int *p_num_calls) {
  if (pp_argv[0] != NULL) {
    *p_num_calls += 1;
    return priv_usch_command(pp_argv, input, first, last, p_child_pid, pp_out);
  }
  return 0;
}


x86 assembly (clang, -O0):
<priv_usch_run>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0x10(%rbp),%rax
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
je     116c <priv_usch_run+0x5c>
mov    0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
mov    -0x1c(%rbp),%ecx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
call   1030 <priv_usch_command@plt>
mov    %eax,-0x4(%rbp)
jmp    1173 <priv_usch_run+0x63>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<priv_usch_run>:
cmpq   $0x0,(%rdi)
je     1123 <priv_usch_run+0x13>
mov    0x8(%rsp),%rax
addl   $0x1,(%rax)
jmp    1030 <priv_usch_command@plt>
xor    %eax,%eax
ret

LLVM IR (-O0):
%struct.priv_usch_stash_item = type { i32 }
define i32 @priv_usch_run(i8** %0, i32 %1, i32 %2, i32 %3, i32* %4, %struct.priv_usch_stash_item** %5, i32* %6) {
%8 = alloca i32
%9 = alloca i8**
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32*
%14 = alloca %struct.priv_usch_stash_item**
%15 = alloca i32*
store i8** %0, i8*** %9
store i32 %1, i32* %10
store i32 %2, i32* %11
store i32 %3, i32* %12
store i32* %4, i32** %13
store %struct.priv_usch_stash_item** %5, %struct.priv_usch_stash_item*** %14
store i32* %6, i32** %15
%16 = load i8**, i8*** %9
%17 = getelementptr inbounds i8*, i8** %16, i64 0
%18 = load i8*, i8** %17
%19 = icmp ne i8* %18, null
br i1 %19, label %20, label %31
20: ; preds = %7
%21 = load i32*, i32** %15
%22 = load i32, i32* %21
%23 = add nsw i32 %22, 1
store i32 %23, i32* %21
%24 = load i8**, i8*** %9
%25 = load i32, i32* %10
%26 = load i32, i32* %11
%27 = load i32, i32* %12
%28 = load i32*, i32** %13
%29 = load %struct.priv_usch_stash_item**, %struct.priv_usch_stash_item*** %14
%30 = call i32 @priv_usch_command(i8** %24, i32 %25, i32 %26, i32 %27, i32* %28, %struct.priv_usch_stash_item** %29)
store i32 %30, i32* %8
br label %32
31: ; preds = %7
store i32 0, i32* %8
br label %32
32: ; preds = %31, %20
%33 = load i32, i32* %8
ret i32 %33
}

LLVM IR (-O2):
%struct.priv_usch_stash_item = type { i32 }
define i32 @priv_usch_run(i8** %0, i32 %1, i32 %2, i32 %3, i32* %4, %struct.priv_usch_stash_item** %5, i32* nocapture %6) {
%8 = load i8*, i8** %0
%9 = icmp eq i8* %8, null
br i1 %9, label %14, label %10
10: ; preds = %7
%11 = load i32, i32* %6
%12 = add nsw i32 %11, 1
store i32 %12, i32* %6
%13 = tail call i32 @priv_usch_command(i8** %0, i32 %1, i32 %2, i32 %3, i32* %4, %struct.priv_usch_stash_item** %5)
br label %14
14: ; preds = %7, %10
%15 = phi i32 [ %13, %10 ], [ 0, %7 ]
ret i32 %15
}