#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 pierwsza(int);
int main(int argc, char *argv[]) {
  int i, pierwsze = 0, start = atoi(argv[1]), end = atoi(argv[2]);
  for (i = start; i < end; i++) {
    if (pierwsza(i) == 1)
      pierwsze++;
  }
  exit(pierwsze);
  return i;
}


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   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    11ac <main+0x7c>
mov    -0x14(%rbp),%edi
call   1030 <pierwsza@plt>
cmp    $0x1,%eax
jne    1199 <main+0x69>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    119e <main+0x6e>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1173 <main+0x43>
mov    -0x18(%rbp),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbp
mov    0x8(%rsi),%rdi
call   1040 <atoi@plt>
mov    %eax,%ebx
mov    0x10(%rbp),%rdi
call   1040 <atoi@plt>
xor    %ebp,%ebp
cmp    %eax,%ebx
jge    1179 <main+0x49>
mov    %eax,%r14d
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
mov    %ebx,%edi
call   1030 <pierwsza@plt>
xor    %ecx,%ecx
cmp    $0x1,%eax
sete   %cl
add    %ecx,%ebp
add    $0x1,%ebx
cmp    %ebx,%r14d
jne    1160 <main+0x30>
mov    %ebp,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
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
store i32 0, i32* %7
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 1
%12 = load i8*, i8** %11
%13 = call i32 @atoi(i8* %12)
store i32 %13, i32* %8
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 2
%16 = load i8*, i8** %15
%17 = call i32 @atoi(i8* %16)
store i32 %17, i32* %9
%18 = load i32, i32* %8
store i32 %18, i32* %6
br label %19
19: ; preds = %31, %2
%20 = load i32, i32* %6
%21 = load i32, i32* %9
%22 = icmp slt i32 %20, %21
br i1 %22, label %23, label %34
23: ; preds = %19
%24 = load i32, i32* %6
%25 = call i32 @pierwsza(i32 %24)
%26 = icmp eq i32 %25, 1
br i1 %26, label %27, label %30
27: ; preds = %23
%28 = load i32, i32* %7
%29 = add nsw i32 %28, 1
store i32 %29, i32* %7
br label %30
30: ; preds = %27, %23
br label %31
31: ; preds = %30
%32 = load i32, i32* %6
%33 = add nsw i32 %32, 1
store i32 %33, i32* %6
br label %19
34: ; preds = %19
%35 = load i32, i32* %7
%36 = call i32 @exit(i32 %35)
unreachable
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @atoi(i8* %4)
%6 = getelementptr inbounds i8*, i8** %1, i64 2
%7 = load i8*, i8** %6
%8 = tail call i32 @atoi(i8* %7)
%9 = icmp slt i32 %5, %8
br i1 %9, label %10, label %19
10: ; preds = %2, %10
%11 = phi i32 [ %17, %10 ], [ %5, %2 ]
%12 = phi i32 [ %16, %10 ], [ 0, %2 ]
%13 = tail call i32 @pierwsza(i32 %11)
%14 = icmp eq i32 %13, 1
%15 = zext i1 %14 to i32
%16 = add nuw nsw i32 %12, %15
%17 = add i32 %11, 1
%18 = icmp eq i32 %17, %8
br i1 %18, label %19, label %10
19: ; preds = %10, %2
%20 = phi i32 [ 0, %2 ], [ %16, %10 ]
%21 = tail call i32 @exit(i32 %20)
unreachable
}