#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*/ STDERR_FILENO;
int /*<<< orphan*/ STDIN_FILENO;
int /*<<< orphan*/ STDOUT_FILENO;
int /*<<< orphan*/ SetUpStdFileDescriptor(char *, int /*<<< orphan*/);
__attribute__((constructor)) void SetUpStdFileDescriptors() {
  SetUpStdFileDescriptor("GSTDERR", STDERR_FILENO);
  SetUpStdFileDescriptor("GSTDOUT", STDOUT_FILENO);
  SetUpStdFileDescriptor("GSTDIN", STDIN_FILENO);
}


x86 assembly (clang, -O0):
<SetUpStdFileDescriptors>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ebd(%rip),%rax
mov    (%rax),%esi
lea    0xedc(%rip),%rdi
call   1030 <SetUpStdFileDescriptor@plt>
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
lea    0xecf(%rip),%rdi
call   1030 <SetUpStdFileDescriptor@plt>
mov    0x2e8b(%rip),%rax
mov    (%rax),%esi
lea    0xec2(%rip),%rdi
call   1030 <SetUpStdFileDescriptor@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<SetUpStdFileDescriptors>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
lea    0xedf(%rip),%rdi
call   1030 <SetUpStdFileDescriptor@plt>
mov    0x2ec3(%rip),%rax
mov    (%rax),%esi
lea    0xed2(%rip),%rdi
call   1030 <SetUpStdFileDescriptor@plt>
mov    0x2e8e(%rip),%rax
mov    (%rax),%esi
lea    0xec5(%rip),%rdi
pop    %rax
jmp    1030 <SetUpStdFileDescriptor@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"GSTDERR\00"
@STDERR_FILENO = global i32 0
@.str.1 = [8 x i8] c"GSTDOUT\00"
@STDOUT_FILENO = global i32 0
@.str.2 = [7 x i8] c"GSTDIN\00"
@STDIN_FILENO = global i32 0
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @SetUpStdFileDescriptors, i8* null }]
define void @SetUpStdFileDescriptors() {
%1 = load i32, i32* @STDERR_FILENO
%2 = call i32 @SetUpStdFileDescriptor(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = load i32, i32* @STDOUT_FILENO
%4 = call i32 @SetUpStdFileDescriptor(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%5 = load i32, i32* @STDIN_FILENO
%6 = call i32 @SetUpStdFileDescriptor(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i32 %5)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"GSTDERR\00"
@STDERR_FILENO = global i32 0
@.str.1 = [8 x i8] c"GSTDOUT\00"
@STDOUT_FILENO = global i32 0
@.str.2 = [7 x i8] c"GSTDIN\00"
@STDIN_FILENO = global i32 0
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @SetUpStdFileDescriptors, i8* null }]
define void @SetUpStdFileDescriptors() {
%1 = load i32, i32* @STDERR_FILENO
%2 = tail call i32 @SetUpStdFileDescriptor(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = load i32, i32* @STDOUT_FILENO
%4 = tail call i32 @SetUpStdFileDescriptor(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%5 = load i32, i32* @STDIN_FILENO
%6 = tail call i32 @SetUpStdFileDescriptor(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i32 %5)
ret void
}