#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*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void usage(const char *prog) {
  fprintf(
      stderr,
      "usage: %s {--denominator|--maxshift|--code} target {source}\n"
      " For each 'source' prints 'mult' and 'add' such that:\n\n"
      "   (number * mult + add) >> 16 = round(number*target/source)\n\n"
      " for all integer values of number in the range 0..source.\n\n"
      " --denominator: swap target and source (specify a single source first\n"
      "                and follow with multiple targets.)\n"
      "    --maxshift: find the lowest shift value that works for all the\n"
      "                repeated 'source' values\n"
      "        --code: output C code for array/structure initialization\n",
      prog);
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [531 x i8] c"usage: %s {--denominator|--maxshift|--code} target {source}\0A For each 'source' prints 'mult' and 'add' such that:\0A\0A (number * mult + add) >> 16 = round(number*target/source)\0A\0A for all integer values of number in the range 0..source.\0A\0A --denominator: swap target and source (specify a single source first\0A and follow with multiple targets.)\0A --maxshift: find the lowest shift value that works for all the\0A repeated 'source' values\0A --code: output C code for array/structure initialization\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([531 x i8], [531 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [531 x i8] c"usage: %s {--denominator|--maxshift|--code} target {source}\0A For each 'source' prints 'mult' and 'add' such that:\0A\0A (number * mult + add) >> 16 = round(number*target/source)\0A\0A for all integer values of number in the range 0..source.\0A\0A --denominator: swap target and source (specify a single source first\0A and follow with multiple targets.)\0A --maxshift: find the lowest shift value that works for all the\0A repeated 'source' values\0A --code: output C code for array/structure initialization\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([531 x i8], [531 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}