#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*/ ntkresolv_safe_exit(int);
int /*<<< orphan*/ printf(char *, ...);
void proto_usage(char *arg) {
  if (arg)
    printf("Bad Protocol %s\n\n", arg);
  else
    printf("ntk-resolv Protocol Help.\n\n");
  printf("Valid protocols are:\n"
         " * tcp\n"
         "   udp\n"
         "(you can also use univoque abbreviation)\n"
         "Note: you can also specify the protocol with option `-s'.\n"
         "To know more, type:\n"
         "\tntk-resolv -s help\n\n");
  ntkresolv_safe_exit(1);
}


x86 assembly (clang, -O0):
<proto_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     114e <proto_usage+0x2e>
mov    -0x8(%rbp),%rsi
lea    0xebe(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    115c <proto_usage+0x3c>
lea    0xebd(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xecb(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x1,%edi
call   1030 <ntkresolv_safe_exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<proto_usage>:
push   %rax
test   %rdi,%rdi
je     1149 <proto_usage+0x19>
mov    %rdi,%rsi
lea    0xec0(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
jmp    1155 <proto_usage+0x25>
lea    0xec2(%rip),%rdi
call   1040 <puts@plt>
lea    0xed1(%rip),%rdi
call   1040 <puts@plt>
mov    $0x1,%edi
pop    %rax
jmp    1030 <ntkresolv_safe_exit@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"Bad Protocol %s\0A\0A\00"
@.str.1 = [28 x i8] c"ntk-resolv Protocol Help.\0A\0A\00"
@.str.2 = [176 x i8] c"Valid protocols are:\0A * tcp\0A udp\0A(you can also use univoque abbreviation)\0ANote: you can also specify the protocol with option `-s'.\0ATo know more, type:\0A\09ntk-resolv -s help\0A\0A\00"
define void @proto_usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %6)
br label %10
8: ; preds = %1
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
br label %10
10: ; preds = %8, %5
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([176 x i8], [176 x i8]* @.str.2, i64 0, i64 0))
%12 = call i32 @ntkresolv_safe_exit(i32 1)
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"Bad Protocol %s\0A\0A\00"
@str = [27 x i8] c"ntk-resolv Protocol Help.\0A\00"
@str.3 = [175 x i8] c"Valid protocols are:\0A * tcp\0A udp\0A(you can also use univoque abbreviation)\0ANote: you can also specify the protocol with option `-s'.\0ATo know more, type:\0A\09ntk-resolv -s help\0A\00"
define void @proto_usage(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %7
5: ; preds = %1
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
br label %7
7: ; preds = %5, %3
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([175 x i8], [175 x i8]* @str.3, i64 0, i64 0))
%9 = tail call i32 @ntkresolv_safe_exit(i32 1)
ret void
}