#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*/ FILE;

/* Variables and functions */
int SIGRTMAX;
int SIGRTMIN;
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ *stdout;
int main(int argc, char **argv) {
  FILE *output = stdout;
  if (argc > 1) {
    output = fopen(argv[1], "w");
    if (!output) {
      perror("fopen");
      return 1;
    }
  }
  fprintf(output, "#define LINUX_SIGRTMIN %d\n", SIGRTMIN);
  fprintf(output, "#define LINUX_SIGRTMAX %d\n", SIGRTMAX);
  fclose(output);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2e73(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    11ae <main+0x6e>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe83(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    11a9 <main+0x69>
lea    0xe6a(%rip),%rdi
call   1060 <perror@plt>
movl   $0x1,-0x4(%rbp)
jmp    11f0 <main+0xb0>
jmp    11ae <main+0x6e>
mov    -0x18(%rbp),%rdi
mov    0x2e1f(%rip),%rax
mov    (%rax),%edx
lea    0xe46(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x18(%rbp),%rdi
mov    0x2e0e(%rip),%rax
mov    (%rax),%edx
lea    0xe48(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
cmp    $0x2,%edi
jl     1171 <main+0x31>
mov    0x8(%rsi),%rdi
lea    0xeaf(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    117b <main+0x3b>
lea    0xe9d(%rip),%rdi
call   1060 <perror@plt>
mov    $0x1,%eax
pop    %rbx
ret
mov    0x2e58(%rip),%rax
mov    (%rax),%rbx
mov    0x2e56(%rip),%rax
mov    (%rax),%edx
lea    0xe7d(%rip),%rsi
mov    %rbx,%rdi
call   1040 <fprintf@plt>
mov    0x2e46(%rip),%rax
mov    (%rax),%edx
lea    0xe80(%rip),%rsi
mov    %rbx,%rdi
call   1040 <fprintf@plt>
mov    %rbx,%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stdout = global i32* null
@.str = [2 x i8] c"w\00"
@.str.1 = [6 x i8] c"fopen\00"
@.str.2 = [27 x i8] c"#define LINUX_SIGRTMIN %d\0A\00"
@SIGRTMIN = global i32 0
@.str.3 = [27 x i8] c"#define LINUX_SIGRTMAX %d\0A\00"
@SIGRTMAX = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32*, i32** @stdout
store i32* %7, i32** %6
%8 = load i32, i32* %4
%9 = icmp sgt i32 %8, 1
br i1 %9, label %10, label %20
10: ; preds = %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = call i32* @fopen(i8* %13, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %14, i32** %6
%15 = load i32*, i32** %6
%16 = icmp ne i32* %15, null
br i1 %16, label %19, label %17
17: ; preds = %10
%18 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
store i32 1, i32* %3
br label %29
19: ; preds = %10
br label %20
20: ; preds = %19, %2
%21 = load i32*, i32** %6
%22 = load i32, i32* @SIGRTMIN
%23 = call i32 @fprintf(i32* %21, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), i32 %22)
%24 = load i32*, i32** %6
%25 = load i32, i32* @SIGRTMAX
%26 = call i32 @fprintf(i32* %24, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0), i32 %25)
%27 = load i32*, i32** %6
%28 = call i32 @fclose(i32* %27)
store i32 0, i32* %3
br label %29
29: ; preds = %20, %17
%30 = load i32, i32* %3
ret i32 %30
}

LLVM IR (-O2):
@stdout = global i32* null
@.str = [2 x i8] c"w\00"
@.str.1 = [6 x i8] c"fopen\00"
@.str.2 = [27 x i8] c"#define LINUX_SIGRTMIN %d\0A\00"
@SIGRTMIN = global i32 0
@.str.3 = [27 x i8] c"#define LINUX_SIGRTMAX %d\0A\00"
@SIGRTMAX = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = load i32*, i32** @stdout
%4 = icmp sgt i32 %0, 1
br i1 %4, label %5, label %12
5: ; preds = %2
%6 = getelementptr inbounds i8*, i8** %1, i64 1
%7 = load i8*, i8** %6
%8 = tail call i32* @fopen(i8* %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%9 = icmp eq i32* %8, null
br i1 %9, label %10, label %12
10: ; preds = %5
%11 = tail call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %19
12: ; preds = %5, %2
%13 = phi i32* [ %8, %5 ], [ %3, %2 ]
%14 = load i32, i32* @SIGRTMIN
%15 = tail call i32 @fprintf(i32* %13, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), i32 %14)
%16 = load i32, i32* @SIGRTMAX
%17 = tail call i32 @fprintf(i32* %13, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0), i32 %16)
%18 = tail call i32 @fclose(i32* %13)
br label %19
19: ; preds = %12, %10
%20 = phi i32 [ 0, %12 ], [ 1, %10 ]
ret i32 %20
}