#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 realm_usage(char *arg) {
  if (arg)
    printf("Bad Realm %s\n\n", arg);
  else
    printf("ntk-resolv Realm Help.\n\n");
  printf("Valid realms are:\n"
         " * ntk\tnetsukuku realm\n"
         "   inet\tinternet realm\n\n"
         "(you can also use univoque abbreviation)\n\n");
  ntkresolv_safe_exit(1);
}


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

LLVM IR (-O0):
@.str = [15 x i8] c"Bad Realm %s\0A\0A\00"
@.str.1 = [25 x i8] c"ntk-resolv Realm Help.\0A\0A\00"
@.str.2 = [108 x i8] c"Valid realms are:\0A * ntk\09netsukuku realm\0A inet\09internet realm\0A\0A(you can also use univoque abbreviation)\0A\0A\00"
define void @realm_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 ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %6)
br label %10
8: ; preds = %1
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
br label %10
10: ; preds = %8, %5
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([108 x i8], [108 x i8]* @.str.2, i64 0, i64 0))
%12 = call i32 @ntkresolv_safe_exit(i32 1)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"Bad Realm %s\0A\0A\00"
@str = [24 x i8] c"ntk-resolv Realm Help.\0A\00"
@str.3 = [107 x i8] c"Valid realms are:\0A * ntk\09netsukuku realm\0A inet\09internet realm\0A\0A(you can also use univoque abbreviation)\0A\00"
define void @realm_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 ([15 x i8], [15 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 ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
br label %7
7: ; preds = %5, %3
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([107 x i8], [107 x i8]* @str.3, i64 0, i64 0))
%9 = tail call i32 @ntkresolv_safe_exit(i32 1)
ret void
}