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

/* Variables and functions */
int /*<<< orphan*/ CPU_SET(int, int /*<<< orphan*/ *);
int /*<<< orphan*/ CPU_ZERO(int /*<<< orphan*/ *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ getppid();
int sched_setaffinity(int /*<<< orphan*/, int, int /*<<< orphan*/ *);
int main(int argc, char *argv[]) {
  cpu_set_t set;
  CPU_ZERO(&set);
  CPU_SET(243, &set);
  CPU_SET(242, &set);
  CPU_SET(241, &set);
  CPU_SET(0, &set);
  if (sched_setaffinity(getppid(), sizeof(cpu_set_t), &set) == -1)
    exit(1);
  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)
lea    -0x14(%rbp),%rdi
call   1040 <CPU_ZERO@plt>
mov    $0xf3,%edi
lea    -0x14(%rbp),%rsi
call   1070 <CPU_SET@plt>
mov    $0xf2,%edi
lea    -0x14(%rbp),%rsi
call   1070 <CPU_SET@plt>
mov    $0xf1,%edi
lea    -0x14(%rbp),%rsi
call   1070 <CPU_SET@plt>
xor    %edi,%edi
lea    -0x14(%rbp),%rsi
call   1070 <CPU_SET@plt>
mov    $0x0,%al
call   1050 <getppid@plt>
mov    %eax,%edi
mov    $0x4,%esi
lea    -0x14(%rbp),%rdx
call   1030 <sched_setaffinity@plt>
cmp    $0xffffffff,%eax
jne    11ce <main+0x7e>
mov    $0x1,%edi
call   1060 <exit@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <CPU_ZERO@plt>
mov    $0xf3,%edi
mov    %rbx,%rsi
call   1070 <CPU_SET@plt>
mov    $0xf2,%edi
mov    %rbx,%rsi
call   1070 <CPU_SET@plt>
mov    $0xf1,%edi
mov    %rbx,%rsi
call   1070 <CPU_SET@plt>
xor    %edi,%edi
mov    %rbx,%rsi
call   1070 <CPU_SET@plt>
xor    %eax,%eax
call   1050 <getppid@plt>
mov    %eax,%edi
mov    $0x4,%esi
mov    %rbx,%rdx
call   1030 <sched_setaffinity@plt>
cmp    $0xffffffff,%eax
je     11b6 <main+0x66>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
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 = call i32 @CPU_ZERO(i32* %6)
%8 = call i32 @CPU_SET(i32 243, i32* %6)
%9 = call i32 @CPU_SET(i32 242, i32* %6)
%10 = call i32 @CPU_SET(i32 241, i32* %6)
%11 = call i32 @CPU_SET(i32 0, i32* %6)
%12 = call i32 (...) @getppid()
%13 = call i32 @sched_setaffinity(i32 %12, i32 4, i32* %6)
%14 = icmp eq i32 %13, -1
br i1 %14, label %15, label %17
15: ; preds = %2
%16 = call i32 @exit(i32 1)
unreachable
17: ; preds = %2
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @CPU_ZERO(i32* %3)
%6 = call i32 @CPU_SET(i32 243, i32* %3)
%7 = call i32 @CPU_SET(i32 242, i32* %3)
%8 = call i32 @CPU_SET(i32 241, i32* %3)
%9 = call i32 @CPU_SET(i32 0, i32* %3)
%10 = call i32 (...) @getppid()
%11 = call i32 @sched_setaffinity(i32 %10, i32 4, i32* %3)
%12 = icmp eq i32 %11, -1
br i1 %12, label %13, label %15
13: ; preds = %2
%14 = call i32 @exit(i32 1)
unreachable
15: ; preds = %2
ret i32 0
}