#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*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void validate_argc(int argc) {
  if (argc != 5) {
    fprintf(stderr, "ERROR: You supplied an incorrect number of arguments.\n");
    fprintf(stderr, "ERROR: Correct usage is:\n");
    fprintf(stderr,
            "ERROR: \traycast width height input_file.json output_file.ppm\n");
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<validate_argc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x5,-0x4(%rbp)
je     1182 <validate_argc+0x62>
mov    0x2ea4(%rip),%rax
mov    (%rax),%edi
lea    0xebb(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e8f(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e7a(%rip),%rax
mov    (%rax),%edi
lea    0xee2(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e5d(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<validate_argc>:
cmp    $0x5,%edi
jne    1126 <validate_argc+0x6>
ret
push   %rbx
mov    0x2eb2(%rip),%rbx
mov    (%rbx),%edi
lea    0xec9(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xef2(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xefe(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e79(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [55 x i8] c"ERROR: You supplied an incorrect number of arguments.\0A\00"
@.str.1 = [26 x i8] c"ERROR: Correct usage is:\0A\00"
@.str.2 = [62 x i8] c"ERROR: \09raycast width height input_file.json output_file.ppm\0A\00"
@EXIT_FAILURE = global i32 0
define void @validate_argc(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 5
br i1 %4, label %5, label %14
5: ; preds = %1
%6 = load i32, i32* @stderr
%7 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* @stderr
%9 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
%10 = load i32, i32* @stderr
%11 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.2, i64 0, i64 0))
%12 = load i32, i32* @EXIT_FAILURE
%13 = call i32 @exit(i32 %12)
unreachable
14: ; preds = %1
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [55 x i8] c"ERROR: You supplied an incorrect number of arguments.\0A\00"
@.str.1 = [26 x i8] c"ERROR: Correct usage is:\0A\00"
@.str.2 = [62 x i8] c"ERROR: \09raycast width height input_file.json output_file.ppm\0A\00"
@EXIT_FAILURE = global i32 0
define void @validate_argc(i32 %0) {
%2 = icmp eq i32 %0, 5
br i1 %2, label %12, label %3
3: ; preds = %1
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
%8 = load i32, i32* @stderr
%9 = tail call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.2, i64 0, i64 0))
%10 = load i32, i32* @EXIT_FAILURE
%11 = tail call i32 @exit(i32 %10)
unreachable
12: ; preds = %1
ret void
}