#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*/ gsc_error(char *);
scalar_t__ pipe_query(int, char *, char *);
int /*<<< orphan*/ stack_getparamstring(int, char **);
void gsc_pipeline_simple(int pipe, char *buf) {
  char *str;
  if (!stack_getparamstring(1, &str)) {
    gsc_error("[gsc_pipeline_simple()] invalid param type");
    return;
  }
  if (pipe_query(pipe, str, buf)) {
    gsc_error("[gsc_pipeline_simple()] pipeline error");
    return;
  }
}


x86 assembly (clang, -O0):
<gsc_pipeline_simple>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1,%edi
lea    -0x18(%rbp),%rsi
call   1050 <stack_getparamstring@plt>
cmp    $0x0,%eax
jne    1167 <gsc_pipeline_simple+0x37>
lea    0xea3(%rip),%rdi
call   1040 <gsc_error@plt>
jmp    118d <gsc_pipeline_simple+0x5d>
mov    -0x4(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1030 <pipe_query@plt>
cmp    $0x0,%rax
je     118d <gsc_pipeline_simple+0x5d>
lea    0xea3(%rip),%rdi
call   1040 <gsc_error@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gsc_pipeline_simple>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %rsp,%rsi
mov    $0x1,%edi
call   1050 <stack_getparamstring@plt>
test   %eax,%eax
je     1165 <gsc_pipeline_simple+0x35>
mov    (%rsp),%rsi
mov    %ebp,%edi
mov    %rbx,%rdx
call   1030 <pipe_query@plt>
test   %rax,%rax
je     1171 <gsc_pipeline_simple+0x41>
lea    0xec8(%rip),%rdi
jmp    116c <gsc_pipeline_simple+0x3c>
lea    0xe94(%rip),%rdi
call   1040 <gsc_error@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [43 x i8] c"[gsc_pipeline_simple()] invalid param type\00"
@.str.1 = [39 x i8] c"[gsc_pipeline_simple()] pipeline error\00"
define void @gsc_pipeline_simple(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = call i32 @stack_getparamstring(i32 1, i8** %5)
%7 = icmp ne i32 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %2
%9 = call i32 @gsc_error(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
br label %18
10: ; preds = %2
%11 = load i32, i32* %3
%12 = load i8*, i8** %5
%13 = load i8*, i8** %4
%14 = call i64 @pipe_query(i32 %11, i8* %12, i8* %13)
%15 = icmp ne i64 %14, 0
br i1 %15, label %16, label %18
16: ; preds = %10
%17 = call i32 @gsc_error(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0))
br label %18
18: ; preds = %8, %16, %10
ret void
}

LLVM IR (-O2):
@.str = [43 x i8] c"[gsc_pipeline_simple()] invalid param type\00"
@.str.1 = [39 x i8] c"[gsc_pipeline_simple()] pipeline error\00"
define void @gsc_pipeline_simple(i32 %0, i8* %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
%5 = call i32 @stack_getparamstring(i32 1, i8** %3)
%6 = icmp eq i32 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %2
%8 = load i8*, i8** %3
%9 = call i64 @pipe_query(i32 %0, i8* %8, i8* %1)
%10 = icmp eq i64 %9, 0
br i1 %10, label %14, label %11
11: ; preds = %7, %2
%12 = phi i8* [ getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), %2 ], [ getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0), %7 ]
%13 = call i32 @gsc_error(i8* %12)
br label %14
14: ; preds = %11, %7
ret void
}