#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*/ announce_c(char const *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *,
                           char const *);
int /*<<< orphan*/ stderr;
void module_startup_c(const char *name, int argc, int argc_expected,
                      const char *argv_expected, int verbose) {
  if (verbose)
    announce_c(name);
  if (argc == argc_expected)
    return;
  if (verbose)
    fprintf(stderr, "Usage: %s %s\n", name, argv_expected);
  exit(1);
}


x86 assembly (clang, -O0):
<module_startup_c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     115d <module_startup_c+0x2d>
mov    -0x8(%rbp),%rdi
call   1030 <announce_c@plt>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jne    116f <module_startup_c+0x3f>
add    $0x20,%rsp
pop    %rbp
ret
cmpl   $0x0,-0x1c(%rbp)
je     1196 <module_startup_c+0x66>
mov    0x2e60(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0x18(%rbp),%rcx
lea    0xe6f(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<module_startup_c>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%ebp
mov    %esi,%ebx
test   %r8d,%r8d
je     116c <module_startup_c+0x3c>
mov    %rcx,%r14
mov    %rdi,%r15
call   1030 <announce_c@plt>
cmp    %ebp,%ebx
je     1170 <module_startup_c+0x40>
mov    0x2e8a(%rip),%rax
mov    (%rax),%edi
lea    0xea1(%rip),%rsi
mov    %r15,%rdx
mov    %r14,%rcx
call   1040 <fprintf@plt>
jmp    117b <module_startup_c+0x4b>
cmp    %ebp,%ebx
jne    117b <module_startup_c+0x4b>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [14 x i8] c"Usage: %s %s\0A\00"
define void @module_startup_c(i8* %0, i32 %1, i32 %2, i8* %3, i32 %4) {
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i32
store i8* %0, i8** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i8* %3, i8** %9
store i32 %4, i32* %10
%11 = load i32, i32* %10
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %16
13: ; preds = %5
%14 = load i8*, i8** %6
%15 = call i32 @announce_c(i8* %14)
br label %16
16: ; preds = %13, %5
%17 = load i32, i32* %7
%18 = load i32, i32* %8
%19 = icmp eq i32 %17, %18
br i1 %19, label %20, label %21
20: ; preds = %16
ret void
21: ; preds = %16
%22 = load i32, i32* %10
%23 = icmp ne i32 %22, 0
br i1 %23, label %24, label %29
24: ; preds = %21
%25 = load i32, i32* @stderr
%26 = load i8*, i8** %6
%27 = load i8*, i8** %9
%28 = call i32 @fprintf(i32 %25, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %26, i8* %27)
br label %29
29: ; preds = %24, %21
%30 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [14 x i8] c"Usage: %s %s\0A\00"
define void @module_startup_c(i8* %0, i32 %1, i32 %2, i8* %3, i32 %4) {
%6 = icmp eq i32 %4, 0
br i1 %6, label %7, label %9
7: ; preds = %5
%8 = icmp eq i32 %1, %2
br i1 %8, label %12, label %16
9: ; preds = %5
%10 = tail call i32 @announce_c(i8* %0)
%11 = icmp eq i32 %1, %2
br i1 %11, label %12, label %13
12: ; preds = %9, %7
ret void
13: ; preds = %9
%14 = load i32, i32* @stderr
%15 = tail call i32 @fprintf(i32 %14, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %3)
br label %16
16: ; preds = %7, %13
%17 = tail call i32 @exit(i32 1)
unreachable
}