#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*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ print_usage();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ warning(char *, ...);
void arg_error(const char *arg) {
  if (arg == NULL)
    warning("Your arguments are invalid. Please refer to usage.");
  else
    warning("Argument «%s» is invalid. Please refer to usage.", arg);
  printf("\n");
  print_usage();
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<arg_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    116a <arg_error+0x2a>
lea    0xea2(%rip),%rdi
mov    $0x0,%al
call   1030 <warning@plt>
jmp    117c <arg_error+0x3c>
mov    -0x8(%rbp),%rsi
lea    0xebe(%rip),%rdi
mov    $0x0,%al
call   1030 <warning@plt>
lea    0xee3(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1060 <print_usage@plt>
mov    0x2e4a(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<arg_error>:
push   %rax
test   %rdi,%rdi
jne    1156 <arg_error+0x16>
lea    0xeb3(%rip),%rdi
xor    %eax,%eax
call   1040 <warning@plt>
jmp    1167 <arg_error+0x27>
mov    %rdi,%rsi
lea    0xed3(%rip),%rdi
xor    %eax,%eax
call   1040 <warning@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1060 <print_usage@plt>
mov    0x2e61(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [51 x i8] c"Your arguments are invalid. Please refer to usage.\00"
@.str.1 = [51 x i8] c"Argument \C2\AB%s\C2\BB is invalid. Please refer to usage.\00"
@.str.2 = [2 x i8] c"\0A\00"
@EXIT_FAILURE = global i32 0
define void @arg_error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 (i8*, ...) @warning(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
br label %10
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = call i32 (i8*, ...) @warning(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.1, i64 0, i64 0), i8* %8)
br label %10
10: ; preds = %7, %5
%11 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%12 = call i32 (...) @print_usage()
%13 = load i32, i32* @EXIT_FAILURE
%14 = call i32 @exit(i32 %13)
unreachable
}

LLVM IR (-O2):
@.str = [51 x i8] c"Your arguments are invalid. Please refer to usage.\00"
@.str.1 = [51 x i8] c"Argument \C2\AB%s\C2\BB is invalid. Please refer to usage.\00"
@EXIT_FAILURE = global i32 0
define void @arg_error(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 (i8*, ...) @warning(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
br label %7
5: ; preds = %1
%6 = tail call i32 (i8*, ...) @warning(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.1, i64 0, i64 0), i8* %0)
br label %7
7: ; preds = %5, %3
%8 = tail call i32 @putchar(i32 10)
%9 = tail call i32 (...) @print_usage()
%10 = load i32, i32* @EXIT_FAILURE
%11 = tail call i32 @exit(i32 %10)
unreachable
}