#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 int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
int /*<<< orphan*/ *stderr;
int /*<<< orphan*/ *stdout;
void security_help(int rc) {
  FILE *desc = rc ? stderr : stdout;
  fprintf(
      desc,
      "\n"
      "ATA Security Commands:\n"
      " Most of these are VERY DANGEROUS and can destroy all of your data!\n"
      " Due to bugs in older Linux kernels, use of these commands may even\n"
      " trigger kernel segfaults or worse.  EXPERIMENT AT YOUR OWN RISK!\n"
      "\n"
      " --security-freeze           Freeze security settings until reset.\n"
      "\n"
      " --security-set-pass PASSWD  Lock drive, using password PASSWD:\n"
      "                                  Use 'NULL' to set empty password.\n"
      "                                  Drive gets locked if user-passwd is "
      "selected.\n"
      " --security-unlock   PASSWD  Unlock drive.\n"
      " --security-disable  PASSWD  Disable drive locking.\n"
      " --security-erase    PASSWD  Erase a (locked) drive.\n"
      " --security-erase-enhanced PASSWD   Enhanced-erase a (locked) drive.\n"
      "\n"
      " The above four commands may optionally be preceded by these options:\n"
      " --security-mode  LEVEL      Use LEVEL to select security level:\n"
      "                                  h   high security (default).\n"
      "                                  m   maximum security.\n"
      " --user-master    WHICH      Use WHICH to choose password type:\n"
      "                                  u   user-password (default).\n"
      "                                  m   master-password\n");
  exit(rc);
}


x86 assembly (clang, -O0):
<security_help>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1148 <security_help+0x28>
mov    0x2ea4(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
jmp    1156 <security_help+0x36>
mov    0x2e89(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xe97(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x4(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<security_help>:
push   %rbx
mov    %edi,%ebx
test   %edi,%edi
jne    1130 <security_help+0x10>
mov    0x2eaa(%rip),%rax
jmp    1137 <security_help+0x17>
mov    0x2ea9(%rip),%rax
mov    (%rax),%rcx
lea    0xebf(%rip),%rdi
mov    $0x488,%esi
mov    $0x1,%edx
call   1040 <fwrite@plt>
mov    %ebx,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
@stderr = global i32* null
@stdout = global i32* null
@.str = [1161 x i8] c"\0AATA Security Commands:\0A Most of these are VERY DANGEROUS and can destroy all of your data!\0A Due to bugs in older Linux kernels, use of these commands may even\0A trigger kernel segfaults or worse. EXPERIMENT AT YOUR OWN RISK!\0A\0A --security-freeze Freeze security settings until reset.\0A\0A --security-set-pass PASSWD Lock drive, using password PASSWD:\0A Use 'NULL' to set empty password.\0A Drive gets locked if user-passwd is selected.\0A --security-unlock PASSWD Unlock drive.\0A --security-disable PASSWD Disable drive locking.\0A --security-erase PASSWD Erase a (locked) drive.\0A --security-erase-enhanced PASSWD Enhanced-erase a (locked) drive.\0A\0A The above four commands may optionally be preceded by these options:\0A --security-mode LEVEL Use LEVEL to select security level:\0A h high security (default).\0A m maximum security.\0A --user-master WHICH Use WHICH to choose password type:\0A u user-password (default).\0A m master-password\0A\00"
define void @security_help(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = load i32*, i32** @stderr
br label %10
8: ; preds = %1
%9 = load i32*, i32** @stdout
br label %10
10: ; preds = %8, %6
%11 = phi i32* [ %7, %6 ], [ %9, %8 ]
store i32* %11, i32** %3
%12 = load i32*, i32** %3
%13 = call i32 @fprintf(i32* %12, i8* getelementptr inbounds ([1161 x i8], [1161 x i8]* @.str, i64 0, i64 0))
%14 = load i32, i32* %2
%15 = call i32 @exit(i32 %14)
unreachable
}

LLVM IR (-O2):
@stderr = global i32* null
@stdout = global i32* null
@.str = [1161 x i8] c"\0AATA Security Commands:\0A Most of these are VERY DANGEROUS and can destroy all of your data!\0A Due to bugs in older Linux kernels, use of these commands may even\0A trigger kernel segfaults or worse. EXPERIMENT AT YOUR OWN RISK!\0A\0A --security-freeze Freeze security settings until reset.\0A\0A --security-set-pass PASSWD Lock drive, using password PASSWD:\0A Use 'NULL' to set empty password.\0A Drive gets locked if user-passwd is selected.\0A --security-unlock PASSWD Unlock drive.\0A --security-disable PASSWD Disable drive locking.\0A --security-erase PASSWD Erase a (locked) drive.\0A --security-erase-enhanced PASSWD Enhanced-erase a (locked) drive.\0A\0A The above four commands may optionally be preceded by these options:\0A --security-mode LEVEL Use LEVEL to select security level:\0A h high security (default).\0A m maximum security.\0A --user-master WHICH Use WHICH to choose password type:\0A u user-password (default).\0A m master-password\0A\00"
define void @security_help(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = load i32*, i32** @stderr
%4 = load i32*, i32** @stdout
%5 = select i1 %2, i32* %4, i32* %3
%6 = tail call i64 @fwrite(i8* getelementptr inbounds ([1161 x i8], [1161 x i8]* @.str, i64 0, i64 0), i64 1160, i64 1, i32* %5)
%7 = tail call i32 @exit(i32 %0)
unreachable
}