#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 *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char *argv[]) {
  int inicio;
  int fin;
  if (argc != 3) {
    printf("Modo de uso: %s <inicio> <fin>\n\n", argv[0]);
    exit(1);
  }
  inicio = atoi(argv[1]);
  fin = atoi(argv[2]);
  for (int n = inicio; n < fin; n++) {
    int c;
    for (c = 2; c <= n - 1; c++) {
      if (n % c == 0)
        break;
    }
    if (c == n)
      printf("El numero %d es primo.\n", n);
  }
  exit(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)
cmpl   $0x3,-0x8(%rbp)
je     116f <main+0x3f>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xea2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    1211 <main+0xe1>
movl   $0x2,-0x20(%rbp)
mov    -0x20(%rbp),%eax
mov    -0x1c(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jg     11e1 <main+0xb1>
mov    -0x1c(%rbp),%eax
cltd
idivl  -0x20(%rbp)
cmp    $0x0,%edx
jne    11ce <main+0x9e>
jmp    11e1 <main+0xb1>
jmp    11d3 <main+0xa3>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    11a8 <main+0x78>
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jne    11fe <main+0xce>
mov    -0x1c(%rbp),%esi
lea    0xe2a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1203 <main+0xd3>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1195 <main+0x65>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbp
cmp    $0x3,%edi
jne    11b6 <main+0x86>
mov    0x8(%rbp),%rdi
call   1040 <atoi@plt>
mov    %eax,%ebx
mov    0x10(%rbp),%rdi
call   1040 <atoi@plt>
cmp    %eax,%ebx
jge    11d2 <main+0xa2>
mov    %eax,%ebp
lea    0xec4(%rip),%r14
jmp    1173 <main+0x43>
nop
mov    %r14,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    %ebp,%ebx
je     11d2 <main+0xa2>
mov    $0x2,%ecx
cmp    $0x3,%ebx
jl     11b0 <main+0x80>
mov    $0x2,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %ebx,%eax
cltd
idiv   %ecx
test   %edx,%edx
je     11b0 <main+0x80>
add    $0x1,%ecx
cmp    %ecx,%ebx
jne    1190 <main+0x60>
jmp    1160 <main+0x30>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
cmp    %ebx,%ecx
je     1160 <main+0x30>
jmp    116c <main+0x3c>
mov    0x0(%rbp),%rsi
lea    0xe3f(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [33 x i8] c"Modo de uso: %s <inicio> <fin>\0A\0A\00"
@.str.1 = [24 x i8] c"El numero %d es primo.\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 i32
%9 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%10 = load i32, i32* %4
%11 = icmp ne i32 %10, 3
br i1 %11, label %12, label %18
12: ; preds = %2
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i64 0
%15 = load i8*, i8** %14
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %15)
%17 = call i32 @exit(i32 1)
unreachable
18: ; preds = %2
%19 = load i8**, i8*** %5
%20 = getelementptr inbounds i8*, i8** %19, i64 1
%21 = load i8*, i8** %20
%22 = call i32 @atoi(i8* %21)
store i32 %22, i32* %6
%23 = load i8**, i8*** %5
%24 = getelementptr inbounds i8*, i8** %23, i64 2
%25 = load i8*, i8** %24
%26 = call i32 @atoi(i8* %25)
store i32 %26, i32* %7
%27 = load i32, i32* %6
store i32 %27, i32* %8
br label %28
28: ; preds = %56, %18
%29 = load i32, i32* %8
%30 = load i32, i32* %7
%31 = icmp slt i32 %29, %30
br i1 %31, label %32, label %59
32: ; preds = %28
store i32 2, i32* %9
br label %33
33: ; preds = %45, %32
%34 = load i32, i32* %9
%35 = load i32, i32* %8
%36 = sub nsw i32 %35, 1
%37 = icmp sle i32 %34, %36
br i1 %37, label %38, label %48
38: ; preds = %33
%39 = load i32, i32* %8
%40 = load i32, i32* %9
%41 = srem i32 %39, %40
%42 = icmp eq i32 %41, 0
br i1 %42, label %43, label %44
43: ; preds = %38
br label %48
44: ; preds = %38
br label %45
45: ; preds = %44
%46 = load i32, i32* %9
%47 = add nsw i32 %46, 1
store i32 %47, i32* %9
br label %33
48: ; preds = %43, %33
%49 = load i32, i32* %9
%50 = load i32, i32* %8
%51 = icmp eq i32 %49, %50
br i1 %51, label %52, label %55
52: ; preds = %48
%53 = load i32, i32* %8
%54 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 %53)
br label %55
55: ; preds = %52, %48
br label %56
56: ; preds = %55
%57 = load i32, i32* %8
%58 = add nsw i32 %57, 1
store i32 %58, i32* %8
br label %28
59: ; preds = %28
%60 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [33 x i8] c"Modo de uso: %s <inicio> <fin>\0A\0A\00"
@.str.1 = [24 x i8] c"El numero %d es primo.\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 3
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = load i8*, i8** %1
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %2
%9 = getelementptr inbounds i8*, i8** %1, i64 1
%10 = load i8*, i8** %9
%11 = tail call i32 @atoi(i8* %10)
%12 = getelementptr inbounds i8*, i8** %1, i64 2
%13 = load i8*, i8** %12
%14 = tail call i32 @atoi(i8* %13)
%15 = icmp slt i32 %11, %14
br i1 %15, label %16, label %19
16: ; preds = %8, %33
%17 = phi i32 [ %34, %33 ], [ %11, %8 ]
%18 = icmp sgt i32 %17, 2
br i1 %18, label %21, label %28
19: ; preds = %33, %8
%20 = tail call i32 @exit(i32 0)
unreachable
21: ; preds = %16, %25
%22 = phi i32 [ %26, %25 ], [ 2, %16 ]
%23 = srem i32 %17, %22
%24 = icmp eq i32 %23, 0
br i1 %24, label %28, label %25
25: ; preds = %21
%26 = add nuw nsw i32 %22, 1
%27 = icmp eq i32 %26, %17
br i1 %27, label %31, label %21
28: ; preds = %21, %16
%29 = phi i32 [ 2, %16 ], [ %22, %21 ]
%30 = icmp eq i32 %29, %17
br i1 %30, label %31, label %33
31: ; preds = %25, %28
%32 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 %17)
br label %33
33: ; preds = %31, %28
%34 = add i32 %17, 1
%35 = icmp eq i32 %34, %14
br i1 %35, label %19, label %16
}