#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 *, int);
int sscanf(char *, char *, int *);
int /*<<< orphan*/ usage(char *);
int main(int argc, char **argv) {
  int walker = 1;
  int reps = 1;
  int stride = 1;
  if (argc < 2 || argc > 4)
    usage(argv[0]);
  if (argc >= 2) {
    if (sscanf(argv[1], "%d", &walker) != 1)
      usage(argv[0]);
  }
  if (argc >= 3) {
    if (sscanf(argv[2], "%d", &reps) != 1)
      usage(argv[0]);
  }
  if (argc >= 4) {
    if (sscanf(argv[3], "%d", &stride) != 1)
      usage(argv[0]);
  }
  while (reps > 0) {
    printf("%d\n", walker);
    walker += stride;
    reps--;
  }
  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   $0x1,-0x14(%rbp)
movl   $0x1,-0x18(%rbp)
movl   $0x1,-0x1c(%rbp)
cmpl   $0x2,-0x8(%rbp)
jl     116f <main+0x3f>
cmpl   $0x4,-0x8(%rbp)
jle    117b <main+0x4b>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1050 <usage@plt>
cmpl   $0x2,-0x8(%rbp)
jl     11b7 <main+0x87>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe6c(%rip),%rsi
lea    -0x14(%rbp),%rdx
call   1040 <sscanf@plt>
cmp    $0x1,%eax
je     11b2 <main+0x82>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1050 <usage@plt>
jmp    11b7 <main+0x87>
cmpl   $0x3,-0x8(%rbp)
jl     11f3 <main+0xc3>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xe30(%rip),%rsi
lea    -0x18(%rbp),%rdx
call   1040 <sscanf@plt>
cmp    $0x1,%eax
je     11ee <main+0xbe>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1050 <usage@plt>
jmp    11f3 <main+0xc3>
cmpl   $0x4,-0x8(%rbp)
jl     122f <main+0xff>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
lea    0xdf4(%rip),%rsi
lea    -0x1c(%rbp),%rdx
call   1040 <sscanf@plt>
cmp    $0x1,%eax
je     122a <main+0xfa>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1050 <usage@plt>
jmp    122f <main+0xff>
jmp    1234 <main+0x104>
cmpl   $0x0,-0x18(%rbp)
jle    1264 <main+0x134>
mov    -0x14(%rbp),%esi
lea    0xdbb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x1c(%rbp),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
jmp    1234 <main+0x104>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%r14
mov    %edi,%ebx
movl   $0x1,0x10(%rsp)
movl   $0x1,0xc(%rsp)
movl   $0x1,0x14(%rsp)
lea    -0x5(%rbx),%eax
cmp    $0xfffffffc,%eax
ja     1169 <main+0x39>
mov    (%r14),%rdi
call   1050 <usage@plt>
cmp    $0x2,%ebx
jl     11d9 <main+0xa9>
mov    0x8(%r14),%rdi
lea    0xe8c(%rip),%rsi
lea    0x10(%rsp),%rdx
call   1040 <sscanf@plt>
cmp    $0x1,%eax
je     118b <main+0x5b>
mov    (%r14),%rdi
call   1050 <usage@plt>
cmp    $0x3,%ebx
jb     11d9 <main+0xa9>
mov    0x10(%r14),%rdi
lea    0xe65(%rip),%rsi
lea    0xc(%rsp),%rdx
call   1040 <sscanf@plt>
cmp    $0x1,%eax
je     11b2 <main+0x82>
mov    (%r14),%rdi
call   1050 <usage@plt>
cmp    $0x4,%ebx
jb     11d9 <main+0xa9>
mov    0x18(%r14),%rdi
lea    0xe3e(%rip),%rsi
lea    0x14(%rsp),%rdx
call   1040 <sscanf@plt>
cmp    $0x1,%eax
je     11d9 <main+0xa9>
mov    (%r14),%rdi
call   1050 <usage@plt>
cmpl   $0x0,0xc(%rsp)
jle    1214 <main+0xe4>
mov    0x10(%rsp),%esi
lea    0xe18(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    0x10(%rsp),%esi
add    0x14(%rsp),%esi
mov    %esi,0x10(%rsp)
mov    0xc(%rsp),%eax
lea    -0x1(%rax),%ecx
mov    %ecx,0xc(%rsp)
cmp    $0x1,%eax
jg     11f0 <main+0xc0>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%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 i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 1, i32* %6
store i32 1, i32* %7
store i32 1, i32* %8
%9 = load i32, i32* %4
%10 = icmp slt i32 %9, 2
br i1 %10, label %14, label %11
11: ; preds = %2
%12 = load i32, i32* %4
%13 = icmp sgt i32 %12, 4
br i1 %13, label %14, label %19
14: ; preds = %11, %2
%15 = load i8**, i8*** %5
%16 = getelementptr inbounds i8*, i8** %15, i64 0
%17 = load i8*, i8** %16
%18 = call i32 @usage(i8* %17)
br label %19
19: ; preds = %14, %11
%20 = load i32, i32* %4
%21 = icmp sge i32 %20, 2
br i1 %21, label %22, label %34
22: ; preds = %19
%23 = load i8**, i8*** %5
%24 = getelementptr inbounds i8*, i8** %23, i64 1
%25 = load i8*, i8** %24
%26 = call i32 @sscanf(i8* %25, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %6)
%27 = icmp ne i32 %26, 1
br i1 %27, label %28, label %33
28: ; preds = %22
%29 = load i8**, i8*** %5
%30 = getelementptr inbounds i8*, i8** %29, i64 0
%31 = load i8*, i8** %30
%32 = call i32 @usage(i8* %31)
br label %33
33: ; preds = %28, %22
br label %34
34: ; preds = %33, %19
%35 = load i32, i32* %4
%36 = icmp sge i32 %35, 3
br i1 %36, label %37, label %49
37: ; preds = %34
%38 = load i8**, i8*** %5
%39 = getelementptr inbounds i8*, i8** %38, i64 2
%40 = load i8*, i8** %39
%41 = call i32 @sscanf(i8* %40, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %7)
%42 = icmp ne i32 %41, 1
br i1 %42, label %43, label %48
43: ; preds = %37
%44 = load i8**, i8*** %5
%45 = getelementptr inbounds i8*, i8** %44, i64 0
%46 = load i8*, i8** %45
%47 = call i32 @usage(i8* %46)
br label %48
48: ; preds = %43, %37
br label %49
49: ; preds = %48, %34
%50 = load i32, i32* %4
%51 = icmp sge i32 %50, 4
br i1 %51, label %52, label %64
52: ; preds = %49
%53 = load i8**, i8*** %5
%54 = getelementptr inbounds i8*, i8** %53, i64 3
%55 = load i8*, i8** %54
%56 = call i32 @sscanf(i8* %55, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %8)
%57 = icmp ne i32 %56, 1
br i1 %57, label %58, label %63
58: ; preds = %52
%59 = load i8**, i8*** %5
%60 = getelementptr inbounds i8*, i8** %59, i64 0
%61 = load i8*, i8** %60
%62 = call i32 @usage(i8* %61)
br label %63
63: ; preds = %58, %52
br label %64
64: ; preds = %63, %49
br label %65
65: ; preds = %68, %64
%66 = load i32, i32* %7
%67 = icmp sgt i32 %66, 0
br i1 %67, label %68, label %76
68: ; preds = %65
%69 = load i32, i32* %6
%70 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %69)
%71 = load i32, i32* %8
%72 = load i32, i32* %6
%73 = add nsw i32 %72, %71
store i32 %73, i32* %6
%74 = load i32, i32* %7
%75 = add nsw i32 %74, -1
store i32 %75, i32* %7
br label %65
76: ; preds = %65
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = bitcast i32* %3 to i8*
store i32 1, i32* %3
%7 = bitcast i32* %4 to i8*
store i32 1, i32* %4
%8 = bitcast i32* %5 to i8*
store i32 1, i32* %5
%9 = add i32 %0, -5
%10 = icmp ult i32 %9, -3
br i1 %10, label %11, label %15
11: ; preds = %2
%12 = load i8*, i8** %1
%13 = tail call i32 @usage(i8* %12)
%14 = icmp sgt i32 %0, 1
br i1 %14, label %15, label %43
15: ; preds = %2, %11
%16 = getelementptr inbounds i8*, i8** %1, i64 1
%17 = load i8*, i8** %16
%18 = call i32 @sscanf(i8* %17, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%19 = icmp eq i32 %18, 1
br i1 %19, label %23, label %20
20: ; preds = %15
%21 = load i8*, i8** %1
%22 = call i32 @usage(i8* %21)
br label %23
23: ; preds = %15, %20
%24 = icmp ugt i32 %0, 2
br i1 %24, label %25, label %43
25: ; preds = %23
%26 = getelementptr inbounds i8*, i8** %1, i64 2
%27 = load i8*, i8** %26
%28 = call i32 @sscanf(i8* %27, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %4)
%29 = icmp eq i32 %28, 1
br i1 %29, label %33, label %30
30: ; preds = %25
%31 = load i8*, i8** %1
%32 = call i32 @usage(i8* %31)
br label %33
33: ; preds = %25, %30
%34 = icmp ugt i32 %0, 3
br i1 %34, label %35, label %43
35: ; preds = %33
%36 = getelementptr inbounds i8*, i8** %1, i64 3
%37 = load i8*, i8** %36
%38 = call i32 @sscanf(i8* %37, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %5)
%39 = icmp eq i32 %38, 1
br i1 %39, label %43, label %40
40: ; preds = %35
%41 = load i8*, i8** %1
%42 = call i32 @usage(i8* %41)
br label %43
43: ; preds = %11, %23, %35, %40, %33
%44 = load i32, i32* %4
%45 = icmp sgt i32 %44, 0
br i1 %45, label %46, label %57
46: ; preds = %43
%47 = load i32, i32* %3
br label %48
48: ; preds = %46, %48
%49 = phi i32 [ %47, %46 ], [ %53, %48 ]
%50 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %49)
%51 = load i32, i32* %5
%52 = load i32, i32* %3
%53 = add nsw i32 %52, %51
store i32 %53, i32* %3
%54 = load i32, i32* %4
%55 = add nsw i32 %54, -1
store i32 %55, i32* %4
%56 = icmp sgt i32 %54, 1
br i1 %56, label %48, label %57
57: ; preds = %48, %43
ret i32 0
}