#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(int);
int /*<<< orphan*/ printf(char *, int, ...);
void defaultTorchArgCheckHandlerFunction(int condition, int argNumber,
                                         const char *msg) {
  if (!condition) {
    if (msg)
      printf("$ Invalid argument %d: %s\n", argNumber, msg);
    else
      printf("$ Invalid argument %d\n", argNumber);
    exit(-1);
  }
}


x86 assembly (clang, -O0):
<defaultTorchArgCheckHandlerFunction>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    117c <defaultTorchArgCheckHandlerFunction+0x5c>
cmpq   $0x0,-0x10(%rbp)
je     1161 <defaultTorchArgCheckHandlerFunction+0x41>
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
lea    0xeab(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1172 <defaultTorchArgCheckHandlerFunction+0x52>
mov    -0x8(%rbp),%esi
lea    0xeb0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<defaultTorchArgCheckHandlerFunction>:
test   %edi,%edi
je     1125 <defaultTorchArgCheckHandlerFunction+0x5>
ret
push   %rax
test   %rdx,%rdx
jne    1143 <defaultTorchArgCheckHandlerFunction+0x23>
lea    0xee9(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>
lea    0xeb6(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"$ Invalid argument %d: %s\0A\00"
@.str.1 = [23 x i8] c"$ Invalid argument %d\0A\00"
define void @defaultTorchArgCheckHandlerFunction(i32 %0, i32 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 0
br i1 %8, label %21, label %9
9: ; preds = %3
%10 = load i8*, i8** %6
%11 = icmp ne i8* %10, null
br i1 %11, label %12, label %16
12: ; preds = %9
%13 = load i32, i32* %5
%14 = load i8*, i8** %6
%15 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %13, i8* %14)
br label %19
16: ; preds = %9
%17 = load i32, i32* %5
%18 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 %17)
br label %19
19: ; preds = %16, %12
%20 = call i32 @exit(i32 -1)
unreachable
21: ; preds = %3
ret void
}

LLVM IR (-O2):
@.str = [27 x i8] c"$ Invalid argument %d: %s\0A\00"
@.str.1 = [23 x i8] c"$ Invalid argument %d\0A\00"
define void @defaultTorchArgCheckHandlerFunction(i32 %0, i32 %1, i8* %2) {
%4 = icmp eq i32 %0, 0
br i1 %4, label %5, label %13
5: ; preds = %3
%6 = icmp eq i8* %2, null
br i1 %6, label %9, label %7
7: ; preds = %5
%8 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %1, i8* %2)
br label %11
9: ; preds = %5
%10 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 %1)
br label %11
11: ; preds = %9, %7
%12 = tail call i32 @exit(i32 -1)
unreachable
13: ; preds = %3
ret void
}