#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_mk_devcp(uint32_t devcp, uint32_t alternate) {
  if (0 == alternate) {
    printf(" BF1DEVCP0 = 0x%08X\n", devcp);
  } else {
    printf(" BF2DEVCP0 = 0x%08X\n", devcp);
  }
  if (devcp & 0x10000000) {
    printf("               %01x         Code-protect disabled\n",
           0x10000000 >> 28);
  } else {
    printf("               %01x         Code protect enabled\n", 0);
  }
}


x86 assembly (clang, -O0):
<print_mk_devcp>:
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_mk_devcp+0x33>
mov    -0x8(%rbp),%rax
mov    %eax,%esi
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
jmp    1155 <print_mk_devcp+0x45>
mov    -0x8(%rbp),%rax
mov    %eax,%esi
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
and    $0x10000000,%rax
cmp    $0x0,%rax
je     117f <print_mk_devcp+0x6f>
lea    0xeba(%rip),%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
jmp    118d <print_mk_devcp+0x7d>
lea    0xed7(%rip),%rdi
xor    %esi,%esi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_mk_devcp>:
push   %rbx
mov    %rdi,%rbx
test   %rsi,%rsi
lea    0xee2(%rip),%rax
lea    0xef0(%rip),%rdi
cmove  %rax,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
test   $0x10000000,%ebx
jne    1147 <print_mk_devcp+0x37>
lea    0xf1e(%rip),%rdi
xor    %esi,%esi
pop    %rbx
jmp    1030 <printf@plt>
lea    0xedc(%rip),%rdi
mov    $0x1,%esi
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [21 x i8] c" BF1DEVCP0 = 0x%08X\0A\00"
@.str.1 = [21 x i8] c" BF2DEVCP0 = 0x%08X\0A\00"
@.str.2 = [51 x i8] c" %01x Code-protect disabled\0A\00"
@.str.3 = [50 x i8] c" %01x Code protect enabled\0A\00"
define void @print_mk_devcp(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 ([21 x i8], [21 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 ([21 x i8], [21 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, 268435456
%18 = icmp ne i64 %17, 0
br i1 %18, label %19, label %21
19: ; preds = %15
%20 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.2, i64 0, i64 0), i32 1)
br label %23
21: ; preds = %15
%22 = call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.3, i64 0, i64 0), i32 0)
br label %23
23: ; preds = %21, %19
ret void
}

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