#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 */
void *atoi(char *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ prim(unsigned int, int);
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char *argv[]) {
  unsigned int grenze = 2;
  int ausgabe = -1;
  if (argc < 2) {
    printf("Sie haben zu wenig Argumente angegeben!\nSyntax: %s 'Obere "
           "Prüfgrenze','Ausgabenbegrenzung'\n",
           argv[0]);
    exit(1);
  }
  if (argc > 2) {
    ausgabe = atoi(argv[2]);
  }
  grenze = atoi(argv[1]);
  if (grenze < 2)
    printf("Ihre Grenze liegt nicht im Bereich der positiven Primzahlen oder "
           "stellte keine gültige Zahl dar");
  prim(grenze, ausgabe);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x2,-0x14(%rbp)
movl   $0xffffffff,-0x18(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    118d <main+0x4d>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xe84(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
cmpl   $0x2,-0x8(%rbp)
jle    11a7 <main+0x67>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1050 <atoi@plt>
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1050 <atoi@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x2,-0x14(%rbp)
jae    11cf <main+0x8f>
lea    0xe95(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
call   1030 <prim@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
cmp    $0x1,%edi
jle    1196 <main+0x56>
mov    $0xffffffff,%r14d
cmp    $0x2,%edi
je     1163 <main+0x23>
mov    0x10(%rbx),%rdi
call   1050 <atoi@plt>
mov    %rax,%r14
mov    0x8(%rbx),%rdi
call   1050 <atoi@plt>
mov    %rax,%rbx
cmp    $0x1,%ebx
ja     1182 <main+0x42>
lea    0xee2(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %ebx,%edi
mov    %r14d,%esi
call   1030 <prim@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    (%rbx),%rsi
lea    0xe60(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [93 x i8] c"Sie haben zu wenig Argumente angegeben!\0ASyntax: %s 'Obere Pr\C3\BCfgrenze','Ausgabenbegrenzung'\0A\00"
@.str.1 = [97 x i8] c"Ihre Grenze liegt nicht im Bereich der positiven Primzahlen oder stellte keine g\C3\BCltige Zahl dar\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 2, i32* %6
store i32 -1, i32* %7
%8 = load i32, i32* %4
%9 = icmp slt i32 %8, 2
br i1 %9, label %10, label %16
10: ; preds = %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 0
%13 = load i8*, i8** %12
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([93 x i8], [93 x i8]* @.str, i64 0, i64 0), i8* %13)
%15 = call i32 @exit(i32 1)
unreachable
16: ; preds = %2
%17 = load i32, i32* %4
%18 = icmp sgt i32 %17, 2
br i1 %18, label %19, label %25
19: ; preds = %16
%20 = load i8**, i8*** %5
%21 = getelementptr inbounds i8*, i8** %20, i64 2
%22 = load i8*, i8** %21
%23 = call i8* @atoi(i8* %22)
%24 = ptrtoint i8* %23 to i32
store i32 %24, i32* %7
br label %25
25: ; preds = %19, %16
%26 = load i8**, i8*** %5
%27 = getelementptr inbounds i8*, i8** %26, i64 1
%28 = load i8*, i8** %27
%29 = call i8* @atoi(i8* %28)
%30 = ptrtoint i8* %29 to i32
store i32 %30, i32* %6
%31 = load i32, i32* %6
%32 = icmp ult i32 %31, 2
br i1 %32, label %33, label %35
33: ; preds = %25
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([97 x i8], [97 x i8]* @.str.1, i64 0, i64 0))
br label %35
35: ; preds = %33, %25
%36 = load i32, i32* %6
%37 = load i32, i32* %7
%38 = call i32 @prim(i32 %36, i32 %37)
ret i32 0
}

LLVM IR (-O2):
@.str = [93 x i8] c"Sie haben zu wenig Argumente angegeben!\0ASyntax: %s 'Obere Pr\C3\BCfgrenze','Ausgabenbegrenzung'\0A\00"
@.str.1 = [97 x i8] c"Ihre Grenze liegt nicht im Bereich der positiven Primzahlen oder stellte keine g\C3\BCltige Zahl dar\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = load i8*, i8** %1
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([93 x i8], [93 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %2
%9 = icmp eq i32 %0, 2
br i1 %9, label %16, label %10
10: ; preds = %8
%11 = getelementptr inbounds i8*, i8** %1, i64 2
%12 = load i8*, i8** %11
%13 = tail call i8* @atoi(i8* %12)
%14 = ptrtoint i8* %13 to i64
%15 = trunc i64 %14 to i32
br label %16
16: ; preds = %10, %8
%17 = phi i32 [ %15, %10 ], [ -1, %8 ]
%18 = getelementptr inbounds i8*, i8** %1, i64 1
%19 = load i8*, i8** %18
%20 = tail call i8* @atoi(i8* %19)
%21 = ptrtoint i8* %20 to i64
%22 = trunc i64 %21 to i32
%23 = icmp ult i32 %22, 2
br i1 %23, label %24, label %26
24: ; preds = %16
%25 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([97 x i8], [97 x i8]* @.str.1, i64 0, i64 0))
br label %26
26: ; preds = %24, %16
%27 = tail call i32 @prim(i32 %22, i32 %17)
ret i32 0
}