#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 *, ...);
int /*<<< orphan*/ usage(char *);
void help(char *p) {
  printf("ntob, version 1.01\n\n");
  usage(p);
  static char *helpmsg =
      "\nN to Base: Convert a number from one base to another. Bases can be "
      "anything from 2 to 36.\n"
      "Input base defaults to 10. Bases beyond 16 use the alphabet as you'd "
      "expect.\n\n"
      "-1 or -2 calculate 1s or 2s complement\n"
      "\n"
      "Examples:\n"
      "\n"
      "$ ntob -o 2 -n 10             # convert 10 to binary\n"
      "1010\n"
      "\n"
      "$ ntob -o 10 -n 1010 -i 2     # and back\n"
      "10\n"
      "\n"
      "$ ntob -o 8 -n 10             # convert 10 to octal\n"
      "12\n"
      "\n"
      "$ ntob -o 16 -n 10            # base 16 A is equal to decimal 10\n"
      "A\n"
      "\n"
      "$ ntob -o 36 -n 35            # base 36 Z is equal to decimal 35\n"
      "Z\n"
      "\n"
      "$ ntob -o 36 -n  1767707668033969\n"
      "HELLOWORLD\n";
  printf("%s", helpmsg);
}


x86 assembly (clang, -O0):
<help>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1040 <usage@plt>
mov    0x2ee6(%rip),%rsi
lea    0x10f6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<help>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1040 <usage@plt>
lea    0xed5(%rip),%rdi
pop    %rbx
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"ntob, version 1.01\0A\0A\00"
@help.helpmsg = internal global i8* getelementptr inbounds ([562 x i8], [562 x i8]* @.str.1, i32 0, i32 0)
@.str.1 = [562 x i8] c"\0AN to Base: Convert a number from one base to another. Bases can be anything from 2 to 36.\0AInput base defaults to 10. Bases beyond 16 use the alphabet as you'd expect.\0A\0A-1 or -2 calculate 1s or 2s complement\0A\0AExamples:\0A\0A$ ntob -o 2 -n 10 # convert 10 to binary\0A1010\0A\0A$ ntob -o 10 -n 1010 -i 2 # and back\0A10\0A\0A$ ntob -o 8 -n 10 # convert 10 to octal\0A12\0A\0A$ ntob -o 16 -n 10 # base 16 A is equal to decimal 10\0AA\0A\0A$ ntob -o 36 -n 35 # base 36 Z is equal to decimal 35\0AZ\0A\0A$ ntob -o 36 -n 1767707668033969\0AHELLOWORLD\0A\00"
@.str.2 = [3 x i8] c"%s\00"
define void @help(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 @usage(i8* %4)
%6 = load i8*, i8** @help.helpmsg
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %6)
ret void
}

LLVM IR (-O2):
@str = [20 x i8] c"ntob, version 1.01\0A\00"
@str.3 = [561 x i8] c"\0AN to Base: Convert a number from one base to another. Bases can be anything from 2 to 36.\0AInput base defaults to 10. Bases beyond 16 use the alphabet as you'd expect.\0A\0A-1 or -2 calculate 1s or 2s complement\0A\0AExamples:\0A\0A$ ntob -o 2 -n 10 # convert 10 to binary\0A1010\0A\0A$ ntob -o 10 -n 1010 -i 2 # and back\0A10\0A\0A$ ntob -o 8 -n 10 # convert 10 to octal\0A12\0A\0A$ ntob -o 16 -n 10 # base 16 A is equal to decimal 10\0AA\0A\0A$ ntob -o 36 -n 35 # base 36 Z is equal to decimal 35\0AZ\0A\0A$ ntob -o 36 -n 1767707668033969\0AHELLOWORLD\00"
define void @help(i8* %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @usage(i8* %0)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([561 x i8], [561 x i8]* @str.3, i64 0, i64 0))
ret void
}