#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*/ sigset_t;
typedef scalar_t__ pid_t;

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ SIG_UNBLOCK;
int /*<<< orphan*/ execlp(char *, char *, char *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
scalar_t__ fork();
int sigfillset(int /*<<< orphan*/ *);
int sigprocmask(int /*<<< orphan*/, int /*<<< orphan*/ *, int /*<<< orphan*/ *);
pid_t start_child(void) {
  sigset_t mask;
  pid_t pid;
  pid = fork();
  if (0 != pid)
    return pid;
  if (-1 == sigfillset(&mask))
    goto terminate;
  if (-1 == sigprocmask(SIG_UNBLOCK, &mask, NULL))
    goto terminate;
  (void)execlp("rc", "rc", (char *)NULL);
terminate:
  exit(EXIT_FAILURE);
  return (-1);
}


x86 assembly (clang, -O0):
<start_child>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1070 <fork@plt>
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
cmp    -0x10(%rbp),%rax
je     1179 <start_child+0x29>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret
lea    -0x4(%rbp),%rdi
call   1040 <sigfillset@plt>
mov    %eax,%ecx
mov    $0xffffffff,%eax
cmp    %ecx,%eax
jne    1196 <start_child+0x46>
jmp    11d3 <start_child+0x83>
mov    0x2e4b(%rip),%rax
mov    (%rax),%edi
lea    -0x4(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <sigprocmask@plt>
mov    %eax,%ecx
mov    $0xffffffff,%eax
cmp    %ecx,%eax
jne    11c0 <start_child+0x70>
jmp    11d3 <start_child+0x83>
lea    0xe39(%rip),%rsi
xor    %eax,%eax
mov    %eax,%edx
mov    %rsi,%rdi
call   1060 <execlp@plt>
mov    0x2dfe(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<start_child>:
push   %rax
xor    %eax,%eax
call   1070 <fork@plt>
test   %rax,%rax
je     115f <start_child+0xf>
pop    %rcx
ret
lea    0x4(%rsp),%rdi
call   1040 <sigfillset@plt>
cmp    $0xffffffff,%eax
je     1199 <start_child+0x49>
mov    0x2e73(%rip),%rax
mov    (%rax),%edi
lea    0x4(%rsp),%rsi
xor    %edx,%edx
call   1030 <sigprocmask@plt>
cmp    $0xffffffff,%eax
je     1199 <start_child+0x49>
lea    0xe71(%rip),%rdi
mov    %rdi,%rsi
xor    %edx,%edx
call   1060 <execlp@plt>
mov    0x2e38(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@SIG_UNBLOCK = global i32 0
@.str = [3 x i8] c"rc\00"
@EXIT_FAILURE = global i32 0
define i64 @start_child() {
%1 = alloca i32
%2 = alloca i64
%3 = call i64 (...) @fork()
store i64 %3, i64* %2
%4 = load i64, i64* %2
%5 = icmp ne i64 0, %4
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = load i64, i64* %2
ret i64 %7
8: ; preds = %0
%9 = call i32 @sigfillset(i32* %1)
%10 = icmp eq i32 -1, %9
br i1 %10, label %11, label %12
11: ; preds = %8
br label %19
12: ; preds = %8
%13 = load i32, i32* @SIG_UNBLOCK
%14 = call i32 @sigprocmask(i32 %13, i32* %1, i32* null)
%15 = icmp eq i32 -1, %14
br i1 %15, label %16, label %17
16: ; preds = %12
br label %19
17: ; preds = %12
%18 = 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* null)
br label %19
19: ; preds = %17, %16, %11
%20 = load i32, i32* @EXIT_FAILURE
%21 = call i32 @exit(i32 %20)
unreachable
}

LLVM IR (-O2):
@SIG_UNBLOCK = global i32 0
@.str = [3 x i8] c"rc\00"
@EXIT_FAILURE = global i32 0
define i64 @start_child() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i64 (...) @fork()
%4 = icmp eq i64 %3, 0
br i1 %4, label %6, label %5
5: ; preds = %0
ret i64 %3
6: ; preds = %0
%7 = call i32 @sigfillset(i32* %1)
%8 = icmp eq i32 %7, -1
br i1 %8, label %15, label %9
9: ; preds = %6
%10 = load i32, i32* @SIG_UNBLOCK
%11 = call i32 @sigprocmask(i32 %10, i32* %1, i32* null)
%12 = icmp eq i32 %11, -1
br i1 %12, label %15, label %13
13: ; preds = %9
%14 = 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* null)
br label %15
15: ; preds = %9, %6, %13
%16 = load i32, i32* @EXIT_FAILURE
%17 = call i32 @exit(i32 %16)
unreachable
}