#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*/ error(char *, ...);
int /*<<< orphan*/ fatalerror(char *);
void checknoargs(int argcount, char *args[]) {
  int i, errorcount = 0;
  for (i = 1; i < argcount; i++) {
    if (args[i][0] != '\0') {
      errorcount++;
      if (errorcount == 1)
        error("The following arguments were not recognized:\n");
      error("\t%s\n", args[i]);
    }
  }
  if (errorcount > 0)
    fatalerror("\nTry --help for help.\n");
  return;
}


x86 assembly (clang, -O0):
<checknoargs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    11af <checknoargs+0x8f>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     119c <checknoargs+0x7c>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
cmpl   $0x1,-0x18(%rbp)
jne    1182 <checknoargs+0x62>
lea    0xe85(%rip),%rdi
mov    $0x0,%al
call   1030 <error@plt>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xe99(%rip),%rdi
mov    $0x0,%al
call   1030 <error@plt>
jmp    11a1 <checknoargs+0x81>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    113d <checknoargs+0x1d>
cmpl   $0x0,-0x18(%rbp)
jle    11c5 <checknoargs+0xa5>
lea    0xe73(%rip),%rdi
call   1040 <fatalerror@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checknoargs>:
cmp    $0x2,%edi
jl     11a4 <checknoargs+0x84>
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r13
mov    %edi,%r12d
mov    $0x1,%ebx
lea    0xebe(%rip),%r14
lea    0xee5(%rip),%r15
xor    %ebp,%ebp
jmp    1166 <checknoargs+0x46>
nopl   (%rax)
add    $0x1,%ebp
mov    %r15,%rdi
xor    %eax,%eax
call   1030 <error@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
je     1185 <checknoargs+0x65>
mov    0x0(%r13,%rbx,8),%rsi
cmpb   $0x0,(%rsi)
je     115d <checknoargs+0x3d>
test   %ebp,%ebp
jne    1150 <checknoargs+0x30>
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <error@plt>
mov    0x0(%r13,%rbx,8),%rsi
jmp    1150 <checknoargs+0x30>
test   %ebp,%ebp
lea    0x8(%rsp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jle    11a4 <checknoargs+0x84>
lea    0xe94(%rip),%rdi
jmp    1040 <fatalerror@plt>
ret

LLVM IR (-O0):
@.str = [46 x i8] c"The following arguments were not recognized:\0A\00"
@.str.1 = [5 x i8] c"\09%s\0A\00"
@.str.2 = [23 x i8] c"\0ATry --help for help.\0A\00"
define void @checknoargs(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i8** %1, i8*** %4
store i32 0, i32* %6
store i32 1, i32* %5
br label %7
7: ; preds = %36, %2
%8 = load i32, i32* %5
%9 = load i32, i32* %3
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %39
11: ; preds = %7
%12 = load i8**, i8*** %4
%13 = load i32, i32* %5
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8*, i8** %12, i64 %14
%16 = load i8*, i8** %15
%17 = getelementptr inbounds i8, i8* %16, i64 0
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = icmp ne i32 %19, 0
br i1 %20, label %21, label %35
21: ; preds = %11
%22 = load i32, i32* %6
%23 = add nsw i32 %22, 1
store i32 %23, i32* %6
%24 = load i32, i32* %6
%25 = icmp eq i32 %24, 1
br i1 %25, label %26, label %28
26: ; preds = %21
%27 = call i32 (i8*, ...) @error(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
br label %28
28: ; preds = %26, %21
%29 = load i8**, i8*** %4
%30 = load i32, i32* %5
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds i8*, i8** %29, i64 %31
%33 = load i8*, i8** %32
%34 = call i32 (i8*, ...) @error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %33)
br label %35
35: ; preds = %28, %11
br label %36
36: ; preds = %35
%37 = load i32, i32* %5
%38 = add nsw i32 %37, 1
store i32 %38, i32* %5
br label %7
39: ; preds = %7
%40 = load i32, i32* %6
%41 = icmp sgt i32 %40, 0
br i1 %41, label %42, label %44
42: ; preds = %39
%43 = call i32 @fatalerror(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0))
br label %44
44: ; preds = %42, %39
ret void
}

LLVM IR (-O2):
@.str = [46 x i8] c"The following arguments were not recognized:\0A\00"
@.str.1 = [5 x i8] c"\09%s\0A\00"
@.str.2 = [23 x i8] c"\0ATry --help for help.\0A\00"
define void @checknoargs(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %30
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %22
%7 = phi i64 [ 1, %4 ], [ %24, %22 ]
%8 = phi i32 [ 0, %4 ], [ %23, %22 ]
%9 = getelementptr inbounds i8*, i8** %1, i64 %7
%10 = load i8*, i8** %9
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %22, label %13
13: ; preds = %6
%14 = add nsw i32 %8, 1
%15 = icmp eq i32 %8, 0
br i1 %15, label %16, label %19
16: ; preds = %13
%17 = tail call i32 (i8*, ...) @error(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%18 = load i8*, i8** %9
br label %19
19: ; preds = %16, %13
%20 = phi i8* [ %18, %16 ], [ %10, %13 ]
%21 = tail call i32 (i8*, ...) @error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %20)
br label %22
22: ; preds = %6, %19
%23 = phi i32 [ %14, %19 ], [ %8, %6 ]
%24 = add nuw nsw i64 %7, 1
%25 = icmp eq i64 %24, %5
br i1 %25, label %26, label %6
26: ; preds = %22
%27 = icmp sgt i32 %23, 0
br i1 %27, label %28, label %30
28: ; preds = %26
%29 = tail call i32 @fatalerror(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0))
br label %30
30: ; preds = %2, %28, %26
ret void
}