#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*/ *stdout;
void usage(char *progName, FILE *file) {
  fprintf(file, "Usage: %s [-a] [-s] [-m] [-d] [numbers...]\n", progName);
  fprintf(file, "	--usage:	print this info and exit\n");
  fprintf(file,
          "	-a --add:	add numbers from stdin and print sum\n");
  fprintf(
      file,
      "	-s --subtract:	subtract numbers from stdin and print difference\n");
  fprintf(
      file,
      "	-m --multiply:	multiply numbers from stdin and print product\n");
  fprintf(
      file,
      "	-d --divide:	divide numbers from stdin and print quotient\n");
  if (file == stdout)
    exit(0);
  else
    exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xec1(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x10(%rbp),%rdi
lea    0xedb(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x10(%rbp),%rdi
lea    0xeed(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x10(%rbp),%rdi
lea    0xf0c(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x10(%rbp),%rdi
lea    0xf3c(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x10(%rbp),%rdi
lea    0xf69(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x10(%rbp),%rax
mov    0x2e35(%rip),%rcx
cmp    (%rcx),%rax
jne    11bb <usage+0x9b>
xor    %edi,%edi
call   1040 <exit@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%rdx
lea    0xec2(%rip),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <fprintf@plt>
lea    0xedd(%rip),%rdi
mov    $0x23,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1050 <fwrite@plt>
lea    0xee8(%rip),%rdi
mov    $0x30,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1050 <fwrite@plt>
lea    0xf00(%rip),%rdi
mov    $0x41,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1050 <fwrite@plt>
lea    0xf29(%rip),%rdi
mov    $0x3e,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1050 <fwrite@plt>
lea    0xf4f(%rip),%rdi
mov    $0x3b,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1050 <fwrite@plt>
mov    0x2e14(%rip),%rax
cmp    %rbx,(%rax)
jne    11d8 <usage+0xa8>
xor    %edi,%edi
call   1040 <exit@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [44 x i8] c"Usage: %s [-a] [-s] [-m] [-d] [numbers...]\0A\00"
@.str.1 = [36 x i8] c"\09--usage:\09print this info and exit\0A\00"
@.str.2 = [49 x i8] c"\09-a --add:\09add numbers from stdin and print sum\0A\00"
@.str.3 = [66 x i8] c"\09-s --subtract:\09subtract numbers from stdin and print difference\0A\00"
@.str.4 = [63 x i8] c"\09-m --multiply:\09multiply numbers from stdin and print product\0A\00"
@.str.5 = [60 x i8] c"\09-d --divide:\09divide numbers from stdin and print quotient\0A\00"
@stdout = global i32* null
define void @usage(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %4
%6 = load i8*, i8** %3
%7 = call i32 (i32*, i8*, ...) @fprintf(i32* %5, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = load i32*, i32** %4
%9 = call i32 (i32*, i8*, ...) @fprintf(i32* %8, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0))
%10 = load i32*, i32** %4
%11 = call i32 (i32*, i8*, ...) @fprintf(i32* %10, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.2, i64 0, i64 0))
%12 = load i32*, i32** %4
%13 = call i32 (i32*, i8*, ...) @fprintf(i32* %12, i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.3, i64 0, i64 0))
%14 = load i32*, i32** %4
%15 = call i32 (i32*, i8*, ...) @fprintf(i32* %14, i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.4, i64 0, i64 0))
%16 = load i32*, i32** %4
%17 = call i32 (i32*, i8*, ...) @fprintf(i32* %16, i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.5, i64 0, i64 0))
%18 = load i32*, i32** %4
%19 = load i32*, i32** @stdout
%20 = icmp eq i32* %18, %19
br i1 %20, label %21, label %23
21: ; preds = %2
%22 = call i32 @exit(i32 0)
unreachable
23: ; preds = %2
%24 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [44 x i8] c"Usage: %s [-a] [-s] [-m] [-d] [numbers...]\0A\00"
@.str.1 = [36 x i8] c"\09--usage:\09print this info and exit\0A\00"
@.str.2 = [49 x i8] c"\09-a --add:\09add numbers from stdin and print sum\0A\00"
@.str.3 = [66 x i8] c"\09-s --subtract:\09subtract numbers from stdin and print difference\0A\00"
@.str.4 = [63 x i8] c"\09-m --multiply:\09multiply numbers from stdin and print product\0A\00"
@.str.5 = [60 x i8] c"\09-d --divide:\09divide numbers from stdin and print quotient\0A\00"
@stdout = global i32* null
define void @usage(i8* %0, i32* nocapture %1) {
%3 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %1, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i64 @fwrite(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i64 35, i64 1, i32* %1)
%5 = tail call i64 @fwrite(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.2, i64 0, i64 0), i64 48, i64 1, i32* %1)
%6 = tail call i64 @fwrite(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.3, i64 0, i64 0), i64 65, i64 1, i32* %1)
%7 = tail call i64 @fwrite(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.4, i64 0, i64 0), i64 62, i64 1, i32* %1)
%8 = tail call i64 @fwrite(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.5, i64 0, i64 0), i64 59, i64 1, i32* %1)
%9 = load i32*, i32** @stdout
%10 = icmp eq i32* %9, %1
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = tail call i32 @exit(i32 0)
unreachable
13: ; preds = %2
%14 = tail call i32 @exit(i32 1)
unreachable
}