#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 atoi(char const *);
int /*<<< orphan*/ generatePrimeNumbers(int);
int /*<<< orphan*/ printf(char *, int);
scalar_t__ strncmp(char const *, char const *, int);
int main(int argc, char const *argv[]) {
  int argIndex;
  int limit;
  const char limitArg[] = "--limit";
  for (argIndex = 1; argIndex < argc; argIndex++) {
    if (strncmp(argv[argIndex], limitArg, 8)) {
      limit = atoi(argv[argIndex]);
      printf("Limite de tabla definido en: %d\n", limit);
      break;
    }
  }
  generatePrimeNumbers(limit);
  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)
mov    0xea3(%rip),%rax
mov    %rax,-0x20(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11d3 <main+0x93>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    -0x20(%rbp),%rsi
mov    $0x8,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
je     11c0 <main+0x80>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1060 <atoi@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%esi
lea    0xe52(%rip),%rdi
call   1040 <printf@plt>
jmp    11d3 <main+0x93>
jmp    11c5 <main+0x85>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1168 <main+0x28>
mov    -0x18(%rbp),%edi
call   1050 <generatePrimeNumbers@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%r15
movabs $0x74696d696c2d2d,%rax
mov    %rax,0x8(%rsp)
mov    $0x1,%ebx
lea    0x8(%rsp),%r14
cs nopw 0x0(%rax,%rax,1)
nop
mov    (%r15,%rbx,8),%rdi
mov    %r14,%rsi
mov    $0x8,%edx
call   1030 <strncmp@plt>
add    $0x1,%rbx
test   %rax,%rax
je     1170 <main+0x30>
add    $0xffffffff,%ebx
mov    (%r15,%rbx,8),%rdi
call   1060 <atoi@plt>
mov    %eax,%ebx
lea    0xe61(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    %ebx,%edi
call   1050 <generatePrimeNumbers@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@__const.main.limitArg = [8 x i8] c"--limit\00"
@.str = [33 x i8] c"Limite de tabla definido en: %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca [8 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = bitcast [8 x i8]* %8 to i8*
store i32 1, i32* %6
br label %10
10: ; preds = %33, %2
%11 = load i32, i32* %6
%12 = load i32, i32* %4
%13 = icmp slt i32 %11, %12
br i1 %13, label %14, label %36
14: ; preds = %10
%15 = load i8**, i8*** %5
%16 = load i32, i32* %6
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i8*, i8** %15, i64 %17
%19 = load i8*, i8** %18
%20 = getelementptr inbounds [8 x i8], [8 x i8]* %8, i64 0, i64 0
%21 = call i64 @strncmp(i8* %19, i8* %20, i32 8)
%22 = icmp ne i64 %21, 0
br i1 %22, label %23, label %32
23: ; preds = %14
%24 = load i8**, i8*** %5
%25 = load i32, i32* %6
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds i8*, i8** %24, i64 %26
%28 = load i8*, i8** %27
%29 = call i32 @atoi(i8* %28)
store i32 %29, i32* %7
%30 = load i32, i32* %7
%31 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %30)
br label %36
32: ; preds = %14
br label %33
33: ; preds = %32
%34 = load i32, i32* %6
%35 = add nsw i32 %34, 1
store i32 %35, i32* %6
br label %10
36: ; preds = %23, %10
%37 = load i32, i32* %7
%38 = call i32 @generatePrimeNumbers(i32 %37)
ret i32 0
}

LLVM IR (-O2):
@.str = [33 x i8] c"Limite de tabla definido en: %d\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i64
%4 = bitcast i64* %3 to i8*
store i64 32767015939484973, i64* %3
%5 = sext i32 %0 to i64
br label %6
6: ; preds = %6, %2
%7 = phi i64 [ %13, %6 ], [ 1, %2 ]
%8 = icmp slt i64 %7, %5
%9 = getelementptr inbounds i8*, i8** %1, i64 %7
%10 = load i8*, i8** %9
%11 = call i64 @strncmp(i8* %10, i8* %4, i32 8)
%12 = icmp eq i64 %11, 0
%13 = add nuw nsw i64 %7, 1
br i1 %12, label %6, label %14
14: ; preds = %6
%15 = and i64 %7, 4294967295
%16 = getelementptr inbounds i8*, i8** %1, i64 %15
%17 = load i8*, i8** %16
%18 = call i32 @atoi(i8* %17)
%19 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %18)
%20 = call i32 @generatePrimeNumbers(i32 %18)
ret i32 0
}