#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*/ printf(char *);
scalar_t__ stfle(int, int);
int main() {
  int dw = 2;
  if ((stfle(dw, 1)) && stfle(dw, 2))
    printf("The z/Architecture architectural mode is installed and active\n");
  else
    printf("The z/Architecture architectural mode is not installed\n");
  if (stfle(dw, 7))
    printf("STFLE facility is installed\n");
  else
    printf("STFLE facility is not installed\n");
  dw = 1;
  if ((stfle(dw, 1)) && stfle(dw, 2))
    printf("The z/Architecture architectural mode is installed and active\n");
  else
    printf("The z/Architecture architectural mode is not installed\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    $0x1,%esi
call   1030 <stfle@plt>
cmp    $0x0,%rax
je     1175 <main+0x55>
mov    -0x8(%rbp),%edi
mov    $0x2,%esi
call   1030 <stfle@plt>
cmp    $0x0,%rax
je     1175 <main+0x55>
lea    0xe95(%rip),%rdi
call   1040 <printf@plt>
jmp    1181 <main+0x61>
lea    0xec3(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%edi
mov    $0x7,%esi
call   1030 <stfle@plt>
cmp    $0x0,%rax
je     11a9 <main+0x89>
lea    0xed8(%rip),%rdi
call   1040 <printf@plt>
jmp    11b5 <main+0x95>
lea    0xee4(%rip),%rdi
call   1040 <printf@plt>
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    $0x1,%esi
call   1030 <stfle@plt>
cmp    $0x0,%rax
je     11fb <main+0xdb>
mov    -0x8(%rbp),%edi
mov    $0x2,%esi
call   1030 <stfle@plt>
cmp    $0x0,%rax
je     11fb <main+0xdb>
lea    0xe0f(%rip),%rdi
call   1040 <printf@plt>
jmp    1207 <main+0xe7>
lea    0xe3d(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x2,%edi
mov    $0x1,%esi
call   1040 <stfle@plt>
test   %rax,%rax
je     1152 <main+0x32>
mov    $0x2,%edi
mov    $0x2,%esi
call   1040 <stfle@plt>
test   %rax,%rax
je     1152 <main+0x32>
lea    0xf23(%rip),%rdi
jmp    1159 <main+0x39>
lea    0xec7(%rip),%rdi
call   1030 <puts@plt>
mov    $0x2,%edi
mov    $0x7,%esi
call   1040 <stfle@plt>
test   %rax,%rax
lea    0xe89(%rip),%rax
lea    0xed9(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
mov    $0x1,%esi
call   1040 <stfle@plt>
test   %rax,%rax
je     11b8 <main+0x98>
mov    $0x1,%edi
mov    $0x2,%esi
call   1040 <stfle@plt>
test   %rax,%rax
je     11b8 <main+0x98>
lea    0xebd(%rip),%rdi
jmp    11bf <main+0x9f>
lea    0xe61(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [63 x i8] c"The z/Architecture architectural mode is installed and active\0A\00"
@.str.1 = [56 x i8] c"The z/Architecture architectural mode is not installed\0A\00"
@.str.2 = [29 x i8] c"STFLE facility is installed\0A\00"
@.str.3 = [33 x i8] c"STFLE facility is not installed\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 2, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @stfle(i32 %3, i32 1)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %12
6: ; preds = %0
%7 = load i32, i32* %2
%8 = call i64 @stfle(i32 %7, i32 2)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %6
%11 = call i32 @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0))
br label %14
12: ; preds = %6, %0
%13 = call i32 @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.1, i64 0, i64 0))
br label %14
14: ; preds = %12, %10
%15 = load i32, i32* %2
%16 = call i64 @stfle(i32 %15, i32 7)
%17 = icmp ne i64 %16, 0
br i1 %17, label %18, label %20
18: ; preds = %14
%19 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0))
br label %22
20: ; preds = %14
%21 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.3, i64 0, i64 0))
br label %22
22: ; preds = %20, %18
store i32 1, i32* %2
%23 = load i32, i32* %2
%24 = call i64 @stfle(i32 %23, i32 1)
%25 = icmp ne i64 %24, 0
br i1 %25, label %26, label %32
26: ; preds = %22
%27 = load i32, i32* %2
%28 = call i64 @stfle(i32 %27, i32 2)
%29 = icmp ne i64 %28, 0
br i1 %29, label %30, label %32
30: ; preds = %26
%31 = call i32 @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0))
br label %34
32: ; preds = %26, %22
%33 = call i32 @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.1, i64 0, i64 0))
br label %34
34: ; preds = %32, %30
ret i32 0
}

LLVM IR (-O2):
@str.4 = [32 x i8] c"STFLE facility is not installed\00"
@str.5 = [55 x i8] c"The z/Architecture architectural mode is not installed\00"
@str.7 = [28 x i8] c"STFLE facility is installed\00"
@str.8 = [62 x i8] c"The z/Architecture architectural mode is installed and active\00"
define i32 @main() {
%1 = tail call i64 @stfle(i32 2, i32 1)
%2 = icmp eq i64 %1, 0
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = tail call i64 @stfle(i32 2, i32 2)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %3, %0
br label %7
7: ; preds = %3, %6
%8 = phi i8* [ getelementptr inbounds ([55 x i8], [55 x i8]* @str.5, i64 0, i64 0), %6 ], [ getelementptr inbounds ([62 x i8], [62 x i8]* @str.8, i64 0, i64 0), %3 ]
%9 = tail call i32 @puts(i8* dereferenceable(1) %8)
%10 = tail call i64 @stfle(i32 2, i32 7)
%11 = icmp eq i64 %10, 0
%12 = select i1 %11, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @str.4, i64 0, i64 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @str.7, i64 0, i64 0)
%13 = tail call i32 @puts(i8* dereferenceable(1) %12)
%14 = tail call i64 @stfle(i32 1, i32 1)
%15 = icmp eq i64 %14, 0
br i1 %15, label %19, label %16
16: ; preds = %7
%17 = tail call i64 @stfle(i32 1, i32 2)
%18 = icmp eq i64 %17, 0
br i1 %18, label %19, label %20
19: ; preds = %16, %7
br label %20
20: ; preds = %16, %19
%21 = phi i8* [ getelementptr inbounds ([55 x i8], [55 x i8]* @str.5, i64 0, i64 0), %19 ], [ getelementptr inbounds ([62 x i8], [62 x i8]* @str.8, i64 0, i64 0), %16 ]
%22 = tail call i32 @puts(i8* dereferenceable(1) %21)
ret i32 0
}