#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*/ printf(char *, ...);
long strtol(char *, int /*<<< orphan*/ *, int);
int main(int argc, char *argv[]) {
  long beginning = 0;
  if (argc >= 2) {
    beginning = strtol(argv[1], NULL, 10);
  } else {
    printf("argv[1] is not defined\n");
    return 1;
  }
  for (long i = beginning; i < beginning + 20; i++) {
    printf("%ld\n", i * i);
  }
  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)
movq   $0x0,-0x18(%rbp)
cmpl   $0x2,-0x8(%rbp)
jl     1167 <main+0x47>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1040 <strtol@plt>
mov    %rax,-0x18(%rbp)
jmp    1181 <main+0x61>
lea    0xe92(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    11cd <main+0xad>
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
add    $0x14,%rcx
cmp    %rcx,%rax
jge    11c6 <main+0xa6>
mov    -0x20(%rbp),%rsi
imul   -0x20(%rbp),%rsi
lea    0xe6a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1189 <main+0x69>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
cmp    $0x2,%edi
jl     118f <main+0x5f>
mov    0x8(%rsi),%rdi
xor    %r14d,%r14d
xor    %esi,%esi
mov    $0xa,%edx
call   1050 <strtol@plt>
mov    %rax,%rbx
mov    %rax,%r12
add    $0x13,%r12
lea    0xe9f(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rsi
imul   %rbx,%rsi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x1(%rbx),%rax
cmp    %r12,%rbx
mov    %rax,%rbx
jl     1170 <main+0x40>
jmp    11a1 <main+0x71>
lea    0xe6f(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%r14d
mov    %r14d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [24 x i8] c"argv[1] is not defined\0A\00"
@.str.1 = [5 x i8] c"%ld\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i64
%7 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i64 0, i64* %6
%8 = load i32, i32* %4
%9 = icmp sge i32 %8, 2
br i1 %9, label %10, label %15
10: ; preds = %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = call i64 @strtol(i8* %13, i32* null, i32 10)
store i64 %14, i64* %6
br label %17
15: ; preds = %2
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %3
br label %33
17: ; preds = %10
%18 = load i64, i64* %6
store i64 %18, i64* %7
br label %19
19: ; preds = %29, %17
%20 = load i64, i64* %7
%21 = load i64, i64* %6
%22 = add nsw i64 %21, 20
%23 = icmp slt i64 %20, %22
br i1 %23, label %24, label %32
24: ; preds = %19
%25 = load i64, i64* %7
%26 = load i64, i64* %7
%27 = mul nsw i64 %25, %26
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i64 %27)
br label %29
29: ; preds = %24
%30 = load i64, i64* %7
%31 = add nsw i64 %30, 1
store i64 %31, i64* %7
br label %19
32: ; preds = %19
store i32 0, i32* %3
br label %33
33: ; preds = %32, %15
%34 = load i32, i32* %3
ret i32 %34
}

LLVM IR (-O2):
@.str.1 = [5 x i8] c"%ld\0A\00"
@str = [23 x i8] c"argv[1] is not defined\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %9
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i64 @strtol(i8* nocapture %6, i32* null, i32 10)
%8 = add nsw i64 %7, 19
br label %11
9: ; preds = %2
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
br label %17
11: ; preds = %4, %11
%12 = phi i64 [ %7, %4 ], [ %15, %11 ]
%13 = mul nsw i64 %12, %12
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i64 %13)
%15 = add nsw i64 %12, 1
%16 = icmp slt i64 %12, %8
br i1 %16, label %11, label %17
17: ; preds = %11, %9
%18 = phi i32 [ 1, %9 ], [ 0, %11 ]
ret i32 %18
}