#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*/ fprintf(int /*<<< orphan*/ *, char *, char const *);
void usage(const char *pgm, FILE *fp) {
  fprintf(fp, "Usage: %s [ ipaddress [ netmask [ hostpart ] ] ]\n", pgm);
  fprintf(fp, "       %s 192.168.1.222\n", pgm);
  fprintf(fp, "       %s 192.168.1.222 255.255.255.0\n", pgm);
  fprintf(fp, "       %s 192.168.1.222 255.255.255.0 0.0.0.254\n", pgm);
}


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    0xed1(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xeef(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xef4(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xf07(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
lea    0xedf(%rip),%rsi
mov    %rbx,%rdi
mov    %r14,%rdx
call   1030 <fprintf@plt>
lea    0xeff(%rip),%rsi
mov    %rbx,%rdi
mov    %r14,%rdx
call   1030 <fprintf@plt>
lea    0xf06(%rip),%rsi
mov    %rbx,%rdi
mov    %r14,%rdx
call   1030 <fprintf@plt>
lea    0xf1b(%rip),%rsi
mov    %rbx,%rdi
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [50 x i8] c"Usage: %s [ ipaddress [ netmask [ hostpart ] ] ]\0A\00"
@.str.1 = [25 x i8] c" %s 192.168.1.222\0A\00"
@.str.2 = [39 x i8] c" %s 192.168.1.222 255.255.255.0\0A\00"
@.str.3 = [49 x i8] c" %s 192.168.1.222 255.255.255.0 0.0.0.254\0A\00"
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 @fprintf(i32* %5, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = load i32*, i32** %4
%9 = load i8*, i8** %3
%10 = call i32 @fprintf(i32* %8, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i8* %9)
%11 = load i32*, i32** %4
%12 = load i8*, i8** %3
%13 = call i32 @fprintf(i32* %11, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0), i8* %12)
%14 = load i32*, i32** %4
%15 = load i8*, i8** %3
%16 = call i32 @fprintf(i32* %14, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.3, i64 0, i64 0), i8* %15)
ret void
}

LLVM IR (-O2):
@.str = [50 x i8] c"Usage: %s [ ipaddress [ netmask [ hostpart ] ] ]\0A\00"
@.str.1 = [25 x i8] c" %s 192.168.1.222\0A\00"
@.str.2 = [39 x i8] c" %s 192.168.1.222 255.255.255.0\0A\00"
@.str.3 = [49 x i8] c" %s 192.168.1.222 255.255.255.0 0.0.0.254\0A\00"
define void @usage(i8* %0, i32* nocapture %1) {
%3 = tail call i32 @fprintf(i32* %1, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @fprintf(i32* %1, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%5 = tail call i32 @fprintf(i32* %1, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0), i8* %0)
%6 = tail call i32 @fprintf(i32* %1, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.3, i64 0, i64 0), i8* %0)
ret void
}