#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 *);
int /*<<< orphan*/ gf_error();
int /*<<< orphan*/ stderr;
void usage(int why) {
  fprintf(stderr, "usage: gf_mult a b w [method] - does multiplication of a "
                  "and b in GF(2^w)\n");
  if (why == 'W') {
    fprintf(stderr, "Bad w.\n");
    fprintf(stderr, "Legal w are: 1 - 32, 64 and 128.\n");
    fprintf(stderr,
            "Append 'h' to w to treat a, b and the product as hexadecimal.\n");
    fprintf(stderr,
            "w=128 is hex only (i.e. '128' will be an error - do '128h')\n");
  }
  if (why == 'A')
    fprintf(stderr, "Bad a\n");
  if (why == 'B')
    fprintf(stderr, "Bad b\n");
  if (why == 'M') {
    fprintf(stderr, "Bad Method Specification: ");
    gf_error();
  }
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2e9e(%rip),%rax
mov    (%rax),%edi
lea    0xeb5(%rip),%rsi
call   1030 <fprintf@plt>
cmpl   $0x57,-0x4(%rbp)
jne    11ae <usage+0x7e>
mov    0x2e7f(%rip),%rax
mov    (%rax),%edi
lea    0xee1(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e6a(%rip),%rax
mov    (%rax),%edi
lea    0xed4(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e55(%rip),%rax
mov    (%rax),%edi
lea    0xee1(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e40(%rip),%rax
mov    (%rax),%edi
lea    0xf0b(%rip),%rsi
call   1030 <fprintf@plt>
cmpl   $0x41,-0x4(%rbp)
jne    11cd <usage+0x9d>
mov    0x2e21(%rip),%rax
mov    (%rax),%edi
lea    0xf29(%rip),%rsi
call   1030 <fprintf@plt>
cmpl   $0x42,-0x4(%rbp)
jne    11ec <usage+0xbc>
mov    0x2e02(%rip),%rax
mov    (%rax),%edi
lea    0xf11(%rip),%rsi
call   1030 <fprintf@plt>
cmpl   $0x4d,-0x4(%rbp)
jne    1212 <usage+0xe2>
mov    0x2de3(%rip),%rax
mov    (%rax),%edi
lea    0xef9(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x0,%al
call   1040 <gf_error@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
mov    0x2ea3(%rip),%r14
mov    (%r14),%edi
lea    0xf15(%rip),%rsi
call   1030 <fprintf@plt>
add    $0xffffffbf,%ebx
cmp    $0x16,%ebx
ja     1192 <usage+0x62>
lea    0xea5(%rip),%rax
movslq (%rax,%rbx,4),%rcx
add    %rax,%rcx
jmp    *%rcx
mov    (%r14),%edi
lea    0xfdf(%rip),%rsi
jmp    11d3 <usage+0xa3>
mov    (%r14),%edi
lea    0xfda(%rip),%rsi
jmp    11d3 <usage+0xa3>
mov    (%r14),%edi
lea    0xfd5(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
call   1040 <gf_error@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    (%r14),%edi
lea    0xf01(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%r14),%edi
lea    0xefa(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%r14),%edi
lea    0xf0d(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%r14),%edi
lea    0xf3d(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [75 x i8] c"usage: gf_mult a b w [method] - does multiplication of a and b in GF(2^w)\0A\00"
@.str.1 = [8 x i8] c"Bad w.\0A\00"
@.str.2 = [34 x i8] c"Legal w are: 1 - 32, 64 and 128.\0A\00"
@.str.3 = [63 x i8] c"Append 'h' to w to treat a, b and the product as hexadecimal.\0A\00"
@.str.4 = [61 x i8] c"w=128 is hex only (i.e. '128' will be an error - do '128h')\0A\00"
@.str.5 = [7 x i8] c"Bad a\0A\00"
@.str.6 = [7 x i8] c"Bad b\0A\00"
@.str.7 = [27 x i8] c"Bad Method Specification: \00"
define void @usage(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* %2
%6 = icmp eq i32 %5, 87
br i1 %6, label %7, label %16
7: ; preds = %1
%8 = load i32, i32* @stderr
%9 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%10 = load i32, i32* @stderr
%11 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0))
%12 = load i32, i32* @stderr
%13 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.3, i64 0, i64 0))
%14 = load i32, i32* @stderr
%15 = call i32 @fprintf(i32 %14, i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.4, i64 0, i64 0))
br label %16
16: ; preds = %7, %1
%17 = load i32, i32* %2
%18 = icmp eq i32 %17, 65
br i1 %18, label %19, label %22
19: ; preds = %16
%20 = load i32, i32* @stderr
%21 = call i32 @fprintf(i32 %20, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0))
br label %22
22: ; preds = %19, %16
%23 = load i32, i32* %2
%24 = icmp eq i32 %23, 66
br i1 %24, label %25, label %28
25: ; preds = %22
%26 = load i32, i32* @stderr
%27 = call i32 @fprintf(i32 %26, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0))
br label %28
28: ; preds = %25, %22
%29 = load i32, i32* %2
%30 = icmp eq i32 %29, 77
br i1 %30, label %31, label %35
31: ; preds = %28
%32 = load i32, i32* @stderr
%33 = call i32 @fprintf(i32 %32, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.7, i64 0, i64 0))
%34 = call i32 (...) @gf_error()
br label %35
35: ; preds = %31, %28
%36 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [75 x i8] c"usage: gf_mult a b w [method] - does multiplication of a and b in GF(2^w)\0A\00"
@.str.1 = [8 x i8] c"Bad w.\0A\00"
@.str.2 = [34 x i8] c"Legal w are: 1 - 32, 64 and 128.\0A\00"
@.str.3 = [63 x i8] c"Append 'h' to w to treat a, b and the product as hexadecimal.\0A\00"
@.str.4 = [61 x i8] c"w=128 is hex only (i.e. '128' will be an error - do '128h')\0A\00"
@.str.5 = [7 x i8] c"Bad a\0A\00"
@.str.6 = [7 x i8] c"Bad b\0A\00"
@.str.7 = [27 x i8] c"Bad Method Specification: \00"
define void @usage(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str, i64 0, i64 0))
switch i32 %0, label %23 [
i32 87, label %4
i32 65, label %13
i32 66, label %16
i32 77, label %19
]
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%7 = load i32, i32* @stderr
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0))
%9 = load i32, i32* @stderr
%10 = tail call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.3, i64 0, i64 0))
%11 = load i32, i32* @stderr
%12 = tail call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.4, i64 0, i64 0))
br label %23
13: ; preds = %1
%14 = load i32, i32* @stderr
%15 = tail call i32 @fprintf(i32 %14, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0))
br label %23
16: ; preds = %1
%17 = load i32, i32* @stderr
%18 = tail call i32 @fprintf(i32 %17, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0))
br label %23
19: ; preds = %1
%20 = load i32, i32* @stderr
%21 = tail call i32 @fprintf(i32 %20, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.7, i64 0, i64 0))
%22 = tail call i32 (...) @gf_error()
br label %23
23: ; preds = %16, %13, %4, %1, %19
%24 = tail call i32 @exit(i32 1)
unreachable
}