#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 *);
void print_help(FILE *stream, int exit_code) {
  fprintf(
      stream,
      "KryptoNotes v1.0 - utility to encrypt/decrypt files\n"
      "Copyright (C) 2007-2012 by Arvydas Juskaitis. All rights reserved\n\n"
      "usage: kryponotes [OPTIONS]\n"
      "-h,      --help           Print this option list, then exit.\n"
      "-I,      --info           Display document info\n"
      "-E,      --enc            Perform encryption\n"
      "-D,      --dec            Perform decryption\n"
      "-R,      --read           Extract clear text file\n"
      "-W,      --write          Write/create clear text document\n"
      "-i file, --in=file        Input file\n"
      "-o file, --out=file       Output file\n"
      "-p pwd,  --pwd=pwd        Password for encryption/decryption\n"
      "-v ver,  --ver=ver        Document version\n");
  exit(exit_code);
}


x86 assembly (clang, -O0):
<print_help>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec6(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0xc(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<print_help>:
push   %rbx
mov    %esi,%ebx
mov    %rdi,%rcx
lea    0xed3(%rip),%rdi
mov    $0x27a,%esi
mov    $0x1,%edx
call   1040 <fwrite@plt>
mov    %ebx,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
@.str = [635 x i8] c"KryptoNotes v1.0 - utility to encrypt/decrypt files\0ACopyright (C) 2007-2012 by Arvydas Juskaitis. All rights reserved\0A\0Ausage: kryponotes [OPTIONS]\0A-h, --help Print this option list, then exit.\0A-I, --info Display document info\0A-E, --enc Perform encryption\0A-D, --dec Perform decryption\0A-R, --read Extract clear text file\0A-W, --write Write/create clear text document\0A-i file, --in=file Input file\0A-o file, --out=file Output file\0A-p pwd, --pwd=pwd Password for encryption/decryption\0A-v ver, --ver=ver Document version\0A\00"
define void @print_help(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([635 x i8], [635 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* %4
%8 = call i32 @exit(i32 %7)
unreachable
}

LLVM IR (-O2):
@.str = [635 x i8] c"KryptoNotes v1.0 - utility to encrypt/decrypt files\0ACopyright (C) 2007-2012 by Arvydas Juskaitis. All rights reserved\0A\0Ausage: kryponotes [OPTIONS]\0A-h, --help Print this option list, then exit.\0A-I, --info Display document info\0A-E, --enc Perform encryption\0A-D, --dec Perform decryption\0A-R, --read Extract clear text file\0A-W, --write Write/create clear text document\0A-i file, --in=file Input file\0A-o file, --out=file Output file\0A-p pwd, --pwd=pwd Password for encryption/decryption\0A-v ver, --ver=ver Document version\0A\00"
define void @print_help(i32* nocapture %0, i32 %1) {
%3 = tail call i64 @fwrite(i8* getelementptr inbounds ([635 x i8], [635 x i8]* @.str, i64 0, i64 0), i64 634, i64 1, i32* %0)
%4 = tail call i32 @exit(i32 %1)
unreachable
}