#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 *, ...);
void printUsage(const char *progname) {
  printf("Universal Plug and Play IGD Tool v0.1\n  João Paulo Barraca "
         "<jpbarraca@av.it.pt>\n\n");
  printf("Usage:\t%s ACTION [-p ARGUMENTS]\n", progname);
  printf("  -d,  --discover\t\t:Find local devices\n");
  printf(
      "  -l,  --list \t\t\t:List devices, services, actions and arguments\n");
  printf("  -a,  --action \t\t:Invoque action. Syntax DEVICE:SERVICE:ACTION\n");
  printf("  -p,  --argument\t\t:Sets optional arguments for action. Syntax: "
         "val1,val2,val3...\n");
  printf("  -h,  --help\t\t\t:This help screen\n");
}


x86 assembly (clang, -O0):
<printUsage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xf1e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf31(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf4b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf7e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xfb1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xff6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printUsage>:
push   %rbx
mov    %rdi,%rbx
lea    0xef6(%rip),%rdi
call   1030 <puts@plt>
lea    0xec9(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf2b(%rip),%rdi
call   1030 <puts@plt>
lea    0xf46(%rip),%rdi
call   1030 <puts@plt>
lea    0xf7a(%rip),%rdi
call   1030 <puts@plt>
lea    0xfae(%rip),%rdi
call   1030 <puts@plt>
lea    0xff4(%rip),%rdi
pop    %rbx
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [83 x i8] c"Universal Plug and Play IGD Tool v0.1\0A Jo\C3\A3o Paulo Barraca <jpbarraca@av.it.pt>\0A\0A\00"
@.str.1 = [33 x i8] c"Usage:\09%s ACTION [-p ARGUMENTS]\0A\00"
@.str.2 = [40 x i8] c" -d, --discover\09\09:Find local devices\0A\00"
@.str.3 = [65 x i8] c" -l, --list \09\09\09:List devices, services, actions and arguments\0A\00"
@.str.4 = [65 x i8] c" -a, --action \09\09:Invoque action. Syntax DEVICE:SERVICE:ACTION\0A\00"
@.str.5 = [83 x i8] c" -p, --argument\09\09:Sets optional arguments for action. Syntax: val1,val2,val3...\0A\00"
@.str.6 = [35 x i8] c" -h, --help\09\09\09:This help screen\0A\00"
define void @printUsage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([83 x i8], [83 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0))
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.3, i64 0, i64 0))
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.4, i64 0, i64 0))
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([83 x i8], [83 x i8]* @.str.5, i64 0, i64 0))
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.6, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.1 = [33 x i8] c"Usage:\09%s ACTION [-p ARGUMENTS]\0A\00"
@str = [82 x i8] c"Universal Plug and Play IGD Tool v0.1\0A Jo\C3\A3o Paulo Barraca <jpbarraca@av.it.pt>\0A\00"
@str.7 = [39 x i8] c" -d, --discover\09\09:Find local devices\00"
@str.8 = [64 x i8] c" -l, --list \09\09\09:List devices, services, actions and arguments\00"
@str.9 = [64 x i8] c" -a, --action \09\09:Invoque action. Syntax DEVICE:SERVICE:ACTION\00"
@str.10 = [82 x i8] c" -p, --argument\09\09:Sets optional arguments for action. Syntax: val1,val2,val3...\00"
@str.11 = [34 x i8] c" -h, --help\09\09\09:This help screen\00"
define void @printUsage(i8* %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([82 x i8], [82 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str.7, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([64 x i8], [64 x i8]* @str.8, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([64 x i8], [64 x i8]* @str.9, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([82 x i8], [82 x i8]* @str.10, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str.11, i64 0, i64 0))
ret void
}