#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 scalar_t__ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void print_mm_fsec(uint32_t fsec, uint32_t alternate) {
  if (0 == alternate) {
    printf("    FSEC = 0x%08X\n", fsec);
  } else {
    printf("   AFSEC = 0x%08X\n", fsec);
  }
  if (fsec & 0x80000000) {
    printf("             %01x           Code protection disabled\n",
           0x80000000 >> 28);
  } else {
    printf("             %01x           Code protection enabled\n", 0);
  }
}


x86 assembly (clang, -O0):
<print_mm_fsec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
cmp    -0x10(%rbp),%rax
jne    1143 <print_mm_fsec+0x33>
mov    -0x8(%rbp),%rax
mov    %eax,%esi
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
jmp    1155 <print_mm_fsec+0x45>
mov    -0x8(%rbp),%rax
mov    %eax,%esi
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
movabs $0x80000000,%rax
and    -0x8(%rbp),%rax
cmp    $0x0,%rax
je     1183 <print_mm_fsec+0x73>
lea    0xeb2(%rip),%rdi
mov    $0x8,%esi
call   1030 <printf@plt>
jmp    1191 <print_mm_fsec+0x81>
lea    0xed2(%rip),%rdi
xor    %esi,%esi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_mm_fsec>:
push   %rbx
mov    %rdi,%rbx
test   %rsi,%rsi
lea    0xee2(%rip),%rax
lea    0xeee(%rip),%rdi
cmove  %rax,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
test   $0x80000000,%ebx
jne    1147 <print_mm_fsec+0x37>
lea    0xf1d(%rip),%rdi
xor    %esi,%esi
pop    %rbx
jmp    1030 <printf@plt>
lea    0xed8(%rip),%rdi
mov    $0x8,%esi
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [19 x i8] c" FSEC = 0x%08X\0A\00"
@.str.1 = [19 x i8] c" AFSEC = 0x%08X\0A\00"
@.str.2 = [54 x i8] c" %01x Code protection disabled\0A\00"
@.str.3 = [53 x i8] c" %01x Code protection enabled\0A\00"
define void @print_mm_fsec(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = icmp eq i64 0, %5
br i1 %6, label %7, label %11
7: ; preds = %2
%8 = load i64, i64* %3
%9 = trunc i64 %8 to i32
%10 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %9)
br label %15
11: ; preds = %2
%12 = load i64, i64* %3
%13 = trunc i64 %12 to i32
%14 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32 %13)
br label %15
15: ; preds = %11, %7
%16 = load i64, i64* %3
%17 = and i64 %16, 2147483648
%18 = icmp ne i64 %17, 0
br i1 %18, label %19, label %21
19: ; preds = %15
%20 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.2, i64 0, i64 0), i32 8)
br label %23
21: ; preds = %15
%22 = call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.3, i64 0, i64 0), i32 0)
br label %23
23: ; preds = %21, %19
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c" FSEC = 0x%08X\0A\00"
@.str.1 = [19 x i8] c" AFSEC = 0x%08X\0A\00"
@.str.2 = [54 x i8] c" %01x Code protection disabled\0A\00"
@.str.3 = [53 x i8] c" %01x Code protection enabled\0A\00"
define void @print_mm_fsec(i64 %0, i64 %1) {
%3 = icmp eq i64 %1, 0
%4 = trunc i64 %0 to i32
%5 = select i1 %3, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0)
%6 = tail call i32 @printf(i8* %5, i32 %4)
%7 = and i64 %0, 2147483648
%8 = icmp eq i64 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %2
%10 = tail call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.2, i64 0, i64 0), i32 8)
br label %13
11: ; preds = %2
%12 = tail call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.3, i64 0, i64 0), i32 0)
br label %13
13: ; preds = %11, %9
ret void
}