#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 */
scalar_t__ ENOSYS;
scalar_t__ errno;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int syscall(int /*<<< orphan*/, int, int, int, int, int, int);
int main(void) {
  int err;
  err = syscall(0, 3, 2, 1, 4, 6, 5);
  if (err == -1 && errno == ENOSYS)
    printf("ENOSYS\n");
  printf("xyzzy\n");
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
mov    $0x3,%esi
mov    $0x2,%edx
mov    $0x1,%ecx
mov    $0x4,%r8d
mov    $0x6,%r9d
movl   $0x5,(%rsp)
call   1040 <syscall@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0xffffffff,-0x8(%rbp)
jne    119b <main+0x6b>
mov    0x2e5c(%rip),%rax
mov    (%rax),%rax
mov    0x2e62(%rip),%rcx
cmp    (%rcx),%rax
jne    119b <main+0x6b>
lea    0xe6a(%rip),%rdi
call   1030 <printf@plt>
lea    0xe66(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x5,(%rsp)
xor    %edi,%edi
mov    $0x3,%esi
mov    $0x2,%edx
mov    $0x1,%ecx
mov    $0x4,%r8d
mov    $0x6,%r9d
call   1040 <syscall@plt>
cmp    $0xffffffff,%eax
jne    1181 <main+0x51>
mov    0x2e72(%rip),%rax
mov    (%rax),%rax
mov    0x2e78(%rip),%rcx
cmp    (%rcx),%rax
jne    1181 <main+0x51>
lea    0xe8a(%rip),%rdi
call   1030 <puts@plt>
lea    0xe78(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@errno = global i64 0
@ENOSYS = global i64 0
@.str = [8 x i8] c"ENOSYS\0A\00"
@.str.1 = [7 x i8] c"xyzzy\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @syscall(i32 0, i32 3, i32 2, i32 1, i32 4, i32 6, i32 5)
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %12
6: ; preds = %0
%7 = load i64, i64* @errno
%8 = load i64, i64* @ENOSYS
%9 = icmp eq i64 %7, %8
br i1 %9, label %10, label %12
10: ; preds = %6
%11 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %10, %6, %0
%13 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%14 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@errno = global i64 0
@ENOSYS = global i64 0
@str = [6 x i8] c"xyzzy\00"
@str.2 = [7 x i8] c"ENOSYS\00"
define i32 @main() {
%1 = tail call i32 @syscall(i32 0, i32 3, i32 2, i32 1, i32 4, i32 6, i32 5)
%2 = icmp eq i32 %1, -1
br i1 %2, label %3, label %9
3: ; preds = %0
%4 = load i64, i64* @errno
%5 = load i64, i64* @ENOSYS
%6 = icmp eq i64 %4, %5
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.2, i64 0, i64 0))
br label %9
9: ; preds = %7, %3, %0
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
%11 = tail call i32 @exit(i32 0)
unreachable
}