#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 */
typedef int /*<<< orphan*/ args;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ stderr;
int pshell_disp(char **args) {
  int i;
  if (args[1] == NULL) {
    fprintf(stderr, "pshell: expected argument after Disp");
  } else {
    for (i = 1; i < sizeof(args); i++) {
      if (!(args[i] == NULL)) {
        printf("%s ", args[i]);
      }
    }
    printf("\n");
  }
  return 1;
}


x86 assembly (clang, -O0):
<pshell_disp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,0x8(%rax)
jne    1155 <pshell_disp+0x35>
mov    0x2e9e(%rip),%rax
mov    (%rax),%edi
lea    0xeb5(%rip),%rsi
call   1040 <fprintf@plt>
jmp    11b8 <pshell_disp+0x98>
movl   $0x1,-0xc(%rbp)
movslq -0xc(%rbp),%rax
cmp    $0x8,%rax
jae    11aa <pshell_disp+0x8a>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     1197 <pshell_disp+0x77>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xe95(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    119c <pshell_disp+0x7c>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    115c <pshell_disp+0x3c>
lea    0xe78(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pshell_disp>:
push   %rbx
mov    0x8(%rdi),%rsi
test   %rsi,%rsi
je     11e5 <pshell_disp+0xb5>
mov    %rdi,%rbx
lea    0xedd(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x10(%rbx),%rsi
test   %rsi,%rsi
je     1166 <pshell_disp+0x36>
lea    0xec6(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x18(%rbx),%rsi
test   %rsi,%rsi
je     117d <pshell_disp+0x4d>
lea    0xeaf(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x20(%rbx),%rsi
test   %rsi,%rsi
je     1194 <pshell_disp+0x64>
lea    0xe98(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x28(%rbx),%rsi
test   %rsi,%rsi
je     11ab <pshell_disp+0x7b>
lea    0xe81(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x30(%rbx),%rsi
test   %rsi,%rsi
je     11c2 <pshell_disp+0x92>
lea    0xe6a(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x38(%rbx),%rsi
test   %rsi,%rsi
je     11d9 <pshell_disp+0xa9>
lea    0xe53(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    11fa <pshell_disp+0xca>
mov    0x2df4(%rip),%rax
mov    (%rax),%edi
lea    0xe0b(%rip),%rsi
call   1050 <fprintf@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [37 x i8] c"pshell: expected argument after Disp\00"
@.str.1 = [4 x i8] c"%s \00"
@.str.2 = [2 x i8] c"\0A\00"
define i32 @pshell_disp(i8** %0) {
%2 = alloca i8**
%3 = alloca i32
store i8** %0, i8*** %2
%4 = load i8**, i8*** %2
%5 = getelementptr inbounds i8*, i8** %4, i64 1
%6 = load i8*, i8** %5
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
br label %36
11: ; preds = %1
store i32 1, i32* %3
br label %12
12: ; preds = %31, %11
%13 = load i32, i32* %3
%14 = sext i32 %13 to i64
%15 = icmp ult i64 %14, 8
br i1 %15, label %16, label %34
16: ; preds = %12
%17 = load i8**, i8*** %2
%18 = load i32, i32* %3
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i8*, i8** %17, i64 %19
%21 = load i8*, i8** %20
%22 = icmp eq i8* %21, null
br i1 %22, label %30, label %23
23: ; preds = %16
%24 = load i8**, i8*** %2
%25 = load i32, i32* %3
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds i8*, i8** %24, i64 %26
%28 = load i8*, i8** %27
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %28)
br label %30
30: ; preds = %23, %16
br label %31
31: ; preds = %30
%32 = load i32, i32* %3
%33 = add nsw i32 %32, 1
store i32 %33, i32* %3
br label %12
34: ; preds = %12
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %36
36: ; preds = %34, %8
ret i32 1
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [37 x i8] c"pshell: expected argument after Disp\00"
@.str.1 = [4 x i8] c"%s \00"
define i32 @pshell_disp(i8** nocapture %0) {
%2 = getelementptr inbounds i8*, i8** %0, i64 1
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
br label %47
8: ; preds = %1
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%10 = getelementptr inbounds i8*, i8** %0, i64 2
%11 = load i8*, i8** %10
%12 = icmp eq i8* %11, null
br i1 %12, label %15, label %13
13: ; preds = %8
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %11)
br label %15
15: ; preds = %13, %8
%16 = getelementptr inbounds i8*, i8** %0, i64 3
%17 = load i8*, i8** %16
%18 = icmp eq i8* %17, null
br i1 %18, label %21, label %19
19: ; preds = %15
%20 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %17)
br label %21
21: ; preds = %19, %15
%22 = getelementptr inbounds i8*, i8** %0, i64 4
%23 = load i8*, i8** %22
%24 = icmp eq i8* %23, null
br i1 %24, label %27, label %25
25: ; preds = %21
%26 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %23)
br label %27
27: ; preds = %25, %21
%28 = getelementptr inbounds i8*, i8** %0, i64 5
%29 = load i8*, i8** %28
%30 = icmp eq i8* %29, null
br i1 %30, label %33, label %31
31: ; preds = %27
%32 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %29)
br label %33
33: ; preds = %31, %27
%34 = getelementptr inbounds i8*, i8** %0, i64 6
%35 = load i8*, i8** %34
%36 = icmp eq i8* %35, null
br i1 %36, label %39, label %37
37: ; preds = %33
%38 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %35)
br label %39
39: ; preds = %37, %33
%40 = getelementptr inbounds i8*, i8** %0, i64 7
%41 = load i8*, i8** %40
%42 = icmp eq i8* %41, null
br i1 %42, label %45, label %43
43: ; preds = %39
%44 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %41)
br label %45
45: ; preds = %43, %39
%46 = tail call i32 @putchar(i32 10)
br label %47
47: ; preds = %45, %5
ret i32 1
}