#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*/ close(int);
int /*<<< orphan*/ dup2(int, int);
int /*<<< orphan*/ execlp(char *, char *, char *, int /*<<< orphan*/ *);
extern void be_dc(int in[2], int out[2]) {
  dup2(in[0], 0);
  close(in[0]);
  close(in[1]);
  dup2(out[1], 1);
  close(out[1]);
  close(out[0]);
  execlp("dc", "dc", "-", NULL);
}


x86 assembly (clang, -O0):
<be_dc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
xor    %esi,%esi
call   1030 <dup2@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
call   1040 <close@plt>
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%edi
call   1040 <close@plt>
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%edi
mov    $0x1,%esi
call   1030 <dup2@plt>
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%edi
call   1040 <close@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
call   1040 <close@plt>
lea    0xe6d(%rip),%rsi
lea    0xe69(%rip),%rdx
xor    %eax,%eax
mov    %eax,%ecx
mov    %rsi,%rdi
call   1050 <execlp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<be_dc>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    (%rdi),%edi
xor    %esi,%esi
call   1030 <dup2@plt>
mov    (%rbx),%edi
call   1040 <close@plt>
mov    0x4(%rbx),%edi
call   1040 <close@plt>
mov    0x4(%r14),%edi
mov    $0x1,%esi
call   1030 <dup2@plt>
mov    0x4(%r14),%edi
call   1040 <close@plt>
mov    (%r14),%edi
call   1040 <close@plt>
lea    0xe88(%rip),%rdi
lea    0xe84(%rip),%rdx
mov    %rdi,%rsi
xor    %ecx,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <execlp@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"dc\00"
@.str.1 = [2 x i8] c"-\00"
define void @be_dc(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %3
%6 = getelementptr inbounds i32, i32* %5, i64 0
%7 = load i32, i32* %6
%8 = call i32 @dup2(i32 %7, i32 0)
%9 = load i32*, i32** %3
%10 = getelementptr inbounds i32, i32* %9, i64 0
%11 = load i32, i32* %10
%12 = call i32 @close(i32 %11)
%13 = load i32*, i32** %3
%14 = getelementptr inbounds i32, i32* %13, i64 1
%15 = load i32, i32* %14
%16 = call i32 @close(i32 %15)
%17 = load i32*, i32** %4
%18 = getelementptr inbounds i32, i32* %17, i64 1
%19 = load i32, i32* %18
%20 = call i32 @dup2(i32 %19, i32 1)
%21 = load i32*, i32** %4
%22 = getelementptr inbounds i32, i32* %21, i64 1
%23 = load i32, i32* %22
%24 = call i32 @close(i32 %23)
%25 = load i32*, i32** %4
%26 = getelementptr inbounds i32, i32* %25, i64 0
%27 = load i32, i32* %26
%28 = call i32 @close(i32 %27)
%29 = call i32 @execlp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32* null)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"dc\00"
@.str.1 = [2 x i8] c"-\00"
define void @be_dc(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = tail call i32 @dup2(i32 %3, i32 0)
%5 = load i32, i32* %0
%6 = tail call i32 @close(i32 %5)
%7 = getelementptr inbounds i32, i32* %0, i64 1
%8 = load i32, i32* %7
%9 = tail call i32 @close(i32 %8)
%10 = getelementptr inbounds i32, i32* %1, i64 1
%11 = load i32, i32* %10
%12 = tail call i32 @dup2(i32 %11, i32 1)
%13 = load i32, i32* %10
%14 = tail call i32 @close(i32 %13)
%15 = load i32, i32* %1
%16 = tail call i32 @close(i32 %15)
%17 = tail call i32 @execlp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32* null)
ret void
}