#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*/ EDOM;
int /*<<< orphan*/ EILSEQ;
int /*<<< orphan*/ ERANGE;
int EXIT_SUCCESS;
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ errno;
int main(void) {
  assert(&errno != NULL);
  errno = EDOM;
  assert(errno == EDOM);
  errno = EILSEQ;
  assert(errno == EILSEQ);
  errno = ERANGE;
  assert(errno == ERANGE);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
call   1030 <assert@plt>
mov    0x2eb0(%rip),%rax
mov    (%rax),%ecx
mov    0x2e8f(%rip),%rax
mov    %ecx,(%rax)
mov    0x2e86(%rip),%rax
mov    (%rax),%eax
mov    0x2e95(%rip),%rcx
cmp    (%rcx),%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    0x2e8f(%rip),%rax
mov    (%rax),%ecx
mov    0x2e5e(%rip),%rax
mov    %ecx,(%rax)
mov    0x2e55(%rip),%rax
mov    (%rax),%eax
mov    0x2e74(%rip),%rcx
cmp    (%rcx),%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    0x2e46(%rip),%rax
mov    (%rax),%ecx
mov    0x2e2d(%rip),%rax
mov    %ecx,(%rax)
mov    0x2e24(%rip),%rax
mov    (%rax),%eax
mov    0x2e2b(%rip),%rcx
cmp    (%rcx),%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    0x2dfd(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x1,%edi
call   1030 <assert@plt>
mov    0x2ebe(%rip),%rax
mov    (%rax),%eax
mov    0x2e9d(%rip),%rbx
mov    %eax,(%rbx)
mov    $0x1,%edi
call   1030 <assert@plt>
mov    0x2eb2(%rip),%rax
mov    (%rax),%eax
mov    %eax,(%rbx)
mov    $0x1,%edi
call   1030 <assert@plt>
mov    0x2e85(%rip),%rax
mov    (%rax),%eax
mov    %eax,(%rbx)
mov    $0x1,%edi
call   1030 <assert@plt>
mov    0x2e58(%rip),%rax
mov    (%rax),%eax
pop    %rbx
ret

LLVM IR (-O0):
@errno = global i32 0
@EDOM = global i32 0
@EILSEQ = global i32 0
@ERANGE = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @assert(i32 1)
%3 = load i32, i32* @EDOM
store i32 %3, i32* @errno
%4 = load i32, i32* @errno
%5 = load i32, i32* @EDOM
%6 = icmp eq i32 %4, %5
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = load i32, i32* @EILSEQ
store i32 %9, i32* @errno
%10 = load i32, i32* @errno
%11 = load i32, i32* @EILSEQ
%12 = icmp eq i32 %10, %11
%13 = zext i1 %12 to i32
%14 = call i32 @assert(i32 %13)
%15 = load i32, i32* @ERANGE
store i32 %15, i32* @errno
%16 = load i32, i32* @errno
%17 = load i32, i32* @ERANGE
%18 = icmp eq i32 %16, %17
%19 = zext i1 %18 to i32
%20 = call i32 @assert(i32 %19)
%21 = load i32, i32* @EXIT_SUCCESS
ret i32 %21
}

LLVM IR (-O2):
@errno = global i32 0
@EDOM = global i32 0
@EILSEQ = global i32 0
@ERANGE = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 @assert(i32 1)
%2 = load i32, i32* @EDOM
store i32 %2, i32* @errno
%3 = tail call i32 @assert(i32 1)
%4 = load i32, i32* @EILSEQ
store i32 %4, i32* @errno
%5 = tail call i32 @assert(i32 1)
%6 = load i32, i32* @ERANGE
store i32 %6, i32* @errno
%7 = tail call i32 @assert(i32 1)
%8 = load i32, i32* @EXIT_SUCCESS
ret i32 %8
}