#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 qt_usage(char *arg) {
  if (arg)
    printf("Bad Query Type %s\n\n", arg);
  else
    printf("ntk-resolv Query Type Help.\n\n");
  printf("Valid query types are:\n"
         " * snsd\t\thost:port -> ip\n"
         "   ptr\t\tip -> host\n"
         "   global\thostname -> all services ip\n"
         "   mx\t\thostname MX -> ip\n\n"
         "(you can also use univoque abbreviation)\n"
         "Note: mx query is equivalent to --query-type="
         "snsd AND --service=25\n\n");
  ntkresolv_safe_exit(1);
}


x86 assembly (clang, -O0):
<qt_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     114e <qt_usage+0x2e>
mov    -0x8(%rbp),%rsi
lea    0xebe(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    115c <qt_usage+0x3c>
lea    0xebf(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xecf(%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):
<qt_usage>:
push   %rax
test   %rdi,%rdi
je     1149 <qt_usage+0x19>
mov    %rdi,%rsi
lea    0xec0(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
jmp    1155 <qt_usage+0x25>
lea    0xec4(%rip),%rdi
call   1040 <puts@plt>
lea    0xed5(%rip),%rdi
call   1040 <puts@plt>
mov    $0x1,%edi
pop    %rax
jmp    1030 <ntkresolv_safe_exit@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"Bad Query Type %s\0A\0A\00"
@.str.1 = [30 x i8] c"ntk-resolv Query Type Help.\0A\0A\00"
@.str.2 = [241 x i8] c"Valid query types are:\0A * snsd\09\09host:port -> ip\0A ptr\09\09ip -> host\0A global\09hostname -> all services ip\0A mx\09\09hostname MX -> ip\0A\0A(you can also use univoque abbreviation)\0ANote: mx query is equivalent to --query-type=snsd AND --service=25\0A\0A\00"
define void @qt_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 ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %6)
br label %10
8: ; preds = %1
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
br label %10
10: ; preds = %8, %5
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([241 x i8], [241 x i8]* @.str.2, i64 0, i64 0))
%12 = call i32 @ntkresolv_safe_exit(i32 1)
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"Bad Query Type %s\0A\0A\00"
@str = [29 x i8] c"ntk-resolv Query Type Help.\0A\00"
@str.3 = [240 x i8] c"Valid query types are:\0A * snsd\09\09host:port -> ip\0A ptr\09\09ip -> host\0A global\09hostname -> all services ip\0A mx\09\09hostname MX -> ip\0A\0A(you can also use univoque abbreviation)\0ANote: mx query is equivalent to --query-type=snsd AND --service=25\0A\00"
define void @qt_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 ([20 x i8], [20 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 ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
br label %7
7: ; preds = %5, %3
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([240 x i8], [240 x i8]* @str.3, i64 0, i64 0))
%9 = tail call i32 @ntkresolv_safe_exit(i32 1)
ret void
}