#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 */
struct timespec {
  int tv_nsec;
  int /*<<< orphan*/ tv_sec;
};
struct pollfd {
  int member_0;
  int member_1;
  int /*<<< orphan*/ member_2;
};
struct epoll_event {
  int dummy;
};
typedef int /*<<< orphan*/ sigset_t;

/* Variables and functions */
int /*<<< orphan*/ EPOLL_CTL_ADD;
int /*<<< orphan*/ SIGUSR2;
int /*<<< orphan*/ close(int);
int epoll_create(int);
int /*<<< orphan*/ epoll_ctl(int, int /*<<< orphan*/, int,
                             struct epoll_event *);
int /*<<< orphan*/ epoll_wait(int, struct epoll_event *, int,
                              int /*<<< orphan*/);
int /*<<< orphan*/ poll(struct pollfd *, int, int /*<<< orphan*/);
int /*<<< orphan*/ sigaddset(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ sigemptyset(int /*<<< orphan*/ *);
int main() {
  struct epoll_event ev;
  struct pollfd pfd = {7, 0x23, 0};
  int fd;
  struct timespec tim = {.tv_sec = 0, .tv_nsec = 200000000};
  sigset_t sigs;
  sigemptyset(&sigs);
  sigaddset(&sigs, SIGUSR2);
  fd = epoll_create(32);
  epoll_ctl(fd, EPOLL_CTL_ADD, 13, &ev);
  epoll_wait(fd, &ev, 17, 0);
  close(fd);
  poll(&pfd, 1, 0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xe7a(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xe78(%rip),%eax
mov    %eax,-0x10(%rbp)
mov    0xe72(%rip),%rax
mov    %rax,-0x28(%rbp)
lea    -0x2c(%rbp),%rdi
call   1050 <sigemptyset@plt>
mov    0x2e2a(%rip),%rax
mov    (%rax),%esi
lea    -0x2c(%rbp),%rdi
call   1090 <sigaddset@plt>
mov    $0x20,%edi
call   1080 <epoll_create@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%edi
mov    0x2e18(%rip),%rax
mov    (%rax),%esi
mov    $0xd,%edx
lea    -0x8(%rbp),%rcx
call   1040 <epoll_ctl@plt>
mov    -0x1c(%rbp),%edi
lea    -0x8(%rbp),%rsi
mov    $0x11,%edx
xor    %ecx,%ecx
call   1060 <epoll_wait@plt>
mov    -0x1c(%rbp),%edi
call   1030 <close@plt>
lea    -0x18(%rbp),%rdi
mov    $0x1,%esi
xor    %edx,%edx
call   1070 <poll@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    0xe8b(%rip),%eax
mov    %eax,0x8(%rsp)
mov    0xe78(%rip),%rax
mov    %rax,(%rsp)
lea    0x14(%rsp),%rbx
mov    %rbx,%rdi
call   1050 <sigemptyset@plt>
mov    0x2e38(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdi
call   1090 <sigaddset@plt>
mov    $0x20,%edi
call   1080 <epoll_create@plt>
mov    %eax,%ebx
mov    0x2e2b(%rip),%rax
mov    (%rax),%esi
lea    0x10(%rsp),%r14
mov    %ebx,%edi
mov    $0xd,%edx
mov    %r14,%rcx
call   1040 <epoll_ctl@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    $0x11,%edx
xor    %ecx,%ecx
call   1060 <epoll_wait@plt>
mov    %ebx,%edi
call   1030 <close@plt>
mov    %rsp,%rdi
mov    $0x1,%esi
xor    %edx,%edx
call   1070 <poll@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.pollfd = type { i32, i32, i32 }
%struct.timespec = type { i32, i32 }
%struct.epoll_event = type { i32 }
@__const.main.pfd = %struct.pollfd { i32 7, i32 35, i32 0 }
@__const.main.tim = %struct.timespec { i32 200000000, i32 0 }
@SIGUSR2 = global i32 0
@EPOLL_CTL_ADD = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.epoll_event
%3 = alloca %struct.pollfd
%4 = alloca i32
%5 = alloca %struct.timespec
%6 = alloca i32
store i32 0, i32* %1
%7 = bitcast %struct.pollfd* %3 to i8*
%8 = bitcast %struct.timespec* %5 to i8*
%9 = call i32 @sigemptyset(i32* %6)
%10 = load i32, i32* @SIGUSR2
%11 = call i32 @sigaddset(i32* %6, i32 %10)
%12 = call i32 @epoll_create(i32 32)
store i32 %12, i32* %4
%13 = load i32, i32* %4
%14 = load i32, i32* @EPOLL_CTL_ADD
%15 = call i32 @epoll_ctl(i32 %13, i32 %14, i32 13, %struct.epoll_event* %2)
%16 = load i32, i32* %4
%17 = call i32 @epoll_wait(i32 %16, %struct.epoll_event* %2, i32 17, i32 0)
%18 = load i32, i32* %4
%19 = call i32 @close(i32 %18)
%20 = call i32 @poll(%struct.pollfd* %3, i32 1, i32 0)
ret i32 0
}

LLVM IR (-O2):
%struct.pollfd = type { i32, i32, i32 }
%struct.epoll_event = type { i32 }
@__const.main.pfd = %struct.pollfd { i32 7, i32 35, i32 0 }
@SIGUSR2 = global i32 0
@EPOLL_CTL_ADD = global i32 0
define i32 @main() {
%1 = alloca %struct.epoll_event
%2 = alloca %struct.pollfd
%3 = alloca i32
%4 = bitcast %struct.epoll_event* %1 to i8*
%5 = bitcast %struct.pollfd* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = call i32 @sigemptyset(i32* %3)
%8 = load i32, i32* @SIGUSR2
%9 = call i32 @sigaddset(i32* %3, i32 %8)
%10 = call i32 @epoll_create(i32 32)
%11 = load i32, i32* @EPOLL_CTL_ADD
%12 = call i32 @epoll_ctl(i32 %10, i32 %11, i32 13, %struct.epoll_event* %1)
%13 = call i32 @epoll_wait(i32 %10, %struct.epoll_event* %1, i32 17, i32 0)
%14 = call i32 @close(i32 %10)
%15 = call i32 @poll(%struct.pollfd* %2, i32 1, i32 0)
ret i32 0
}