#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 /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char *argv[]) {
  int check = 0;
  int r, s, t;
  r = atoi(argv[1]);
  s = atoi(argv[2]);
  if (argv[3] != NULL)
    t = atoi(argv[3]);
  else
    t = 1;
  if (argc < 3) {
    printf("\n usage: nums (or program_name) start stop [inc] \n\n");
    exit(0);
  }
  if (r == s)
    printf("\n%d\n", r);
  else if (r > s) {
    while (r >= s) {
      printf("%d\n", r);
      if (t <= 0)
        r += t;
      else
        r -= t;
    }
  } else if (r < s) {
    if (t <= 0)
      printf("\nnums: infinate loop\n");
    else
      while (r <= s) {
        printf("%d\n", r);
        r += t;
      }
  }
  printf("\n");
  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   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,0x18(%rax)
je     1191 <main+0x61>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x20(%rbp)
jmp    1198 <main+0x68>
movl   $0x1,-0x20(%rbp)
cmpl   $0x3,-0x8(%rbp)
jge    11b7 <main+0x87>
lea    0xe57(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jne    11d9 <main+0xa9>
mov    -0x18(%rbp),%esi
lea    0xe67(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12a1 <main+0x171>
mov    -0x18(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jle    1234 <main+0x104>
jmp    11ea <main+0xba>
mov    -0x18(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jl     122f <main+0xff>
mov    -0x18(%rbp),%esi
lea    0xe35(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x0,-0x20(%rbp)
jg     121f <main+0xef>
mov    -0x20(%rbp),%eax
add    -0x18(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    122a <main+0xfa>
mov    -0x20(%rbp),%ecx
mov    -0x18(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x18(%rbp)
jmp    11ea <main+0xba>
jmp    129c <main+0x16c>
mov    -0x18(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    1297 <main+0x167>
cmpl   $0x0,-0x20(%rbp)
jg     125d <main+0x12d>
lea    0xde8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1292 <main+0x162>
jmp    1262 <main+0x132>
mov    -0x18(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jg     128d <main+0x15d>
mov    -0x18(%rbp),%esi
lea    0xdbd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%eax
add    -0x18(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    1262 <main+0x132>
jmp    1292 <main+0x162>
jmp    1297 <main+0x167>
jmp    129c <main+0x16c>
jmp    12a1 <main+0x171>
lea    0xd8a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rsi,%r14
mov    %edi,%r15d
mov    0x8(%rsi),%rdi
call   1060 <atoi@plt>
mov    %eax,%ebx
mov    0x10(%r14),%rdi
call   1060 <atoi@plt>
mov    %eax,%r12d
mov    0x18(%r14),%rdi
test   %rdi,%rdi
je     11d5 <main+0x85>
call   1060 <atoi@plt>
mov    %eax,%r14d
cmp    $0x2,%r15d
jle    11e1 <main+0x91>
cmp    %r12d,%ebx
jne    11a6 <main+0x56>
lea    0xe68(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1050 <printf@plt>
jmp    1232 <main+0xe2>
jle    11f4 <main+0xa4>
mov    %r14d,%ebp
neg    %ebp
cmovs  %r14d,%ebp
lea    0xe49(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1050 <printf@plt>
sub    %ebp,%ebx
cmp    %r12d,%ebx
jge    11c0 <main+0x70>
jmp    1232 <main+0xe2>
mov    $0x1,%r14d
cmp    $0x2,%r15d
jg     118c <main+0x3c>
lea    0xe32(%rip),%rdi
call   1040 <puts@plt>
xor    %edi,%edi
call   1070 <exit@plt>
jge    1232 <main+0xe2>
test   %r14d,%r14d
jle    1226 <main+0xd6>
lea    0xdff(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r15,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1050 <printf@plt>
add    %r14d,%ebx
cmp    %r12d,%ebx
jle    1210 <main+0xc0>
jmp    1232 <main+0xe2>
lea    0xdd8(%rip),%rdi
call   1040 <puts@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [52 x i8] c"\0A usage: nums (or program_name) start stop [inc] \0A\0A\00"
@.str.1 = [5 x i8] c"\0A%d\0A\00"
@.str.2 = [4 x i8] c"%d\0A\00"
@.str.3 = [22 x i8] c"\0Anums: infinate loop\0A\00"
@.str.4 = [2 x i8] c"\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
store i32 0, i32* %6
%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* %7
%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* %8
%18 = load i8**, i8*** %5
%19 = getelementptr inbounds i8*, i8** %18, i64 3
%20 = load i8*, i8** %19
%21 = icmp ne i8* %20, null
br i1 %21, label %22, label %27
22: ; preds = %2
%23 = load i8**, i8*** %5
%24 = getelementptr inbounds i8*, i8** %23, i64 3
%25 = load i8*, i8** %24
%26 = call i32 @atoi(i8* %25)
store i32 %26, i32* %9
br label %28
27: ; preds = %2
store i32 1, i32* %9
br label %28
28: ; preds = %27, %22
%29 = load i32, i32* %4
%30 = icmp slt i32 %29, 3
br i1 %30, label %31, label %34
31: ; preds = %28
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
%33 = call i32 @exit(i32 0)
unreachable
34: ; preds = %28
%35 = load i32, i32* %7
%36 = load i32, i32* %8
%37 = icmp eq i32 %35, %36
br i1 %37, label %38, label %41
38: ; preds = %34
%39 = load i32, i32* %7
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %39)
br label %89
41: ; preds = %34
%42 = load i32, i32* %7
%43 = load i32, i32* %8
%44 = icmp sgt i32 %42, %43
br i1 %44, label %45, label %65
45: ; preds = %41
br label %46
46: ; preds = %63, %45
%47 = load i32, i32* %7
%48 = load i32, i32* %8
%49 = icmp sge i32 %47, %48
br i1 %49, label %50, label %64
50: ; preds = %46
%51 = load i32, i32* %7
%52 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %51)
%53 = load i32, i32* %9
%54 = icmp sle i32 %53, 0
br i1 %54, label %55, label %59
55: ; preds = %50
%56 = load i32, i32* %9
%57 = load i32, i32* %7
%58 = add nsw i32 %57, %56
store i32 %58, i32* %7
br label %63
59: ; preds = %50
%60 = load i32, i32* %9
%61 = load i32, i32* %7
%62 = sub nsw i32 %61, %60
store i32 %62, i32* %7
br label %63
63: ; preds = %59, %55
br label %46
64: ; preds = %46
br label %88
65: ; preds = %41
%66 = load i32, i32* %7
%67 = load i32, i32* %8
%68 = icmp slt i32 %66, %67
br i1 %68, label %69, label %87
69: ; preds = %65
%70 = load i32, i32* %9
%71 = icmp sle i32 %70, 0
br i1 %71, label %72, label %74
72: ; preds = %69
%73 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0))
br label %86
74: ; preds = %69
br label %75
75: ; preds = %79, %74
%76 = load i32, i32* %7
%77 = load i32, i32* %8
%78 = icmp sle i32 %76, %77
br i1 %78, label %79, label %85
79: ; preds = %75
%80 = load i32, i32* %7
%81 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %80)
%82 = load i32, i32* %9
%83 = load i32, i32* %7
%84 = add nsw i32 %83, %82
store i32 %84, i32* %7
br label %75
85: ; preds = %75
br label %86
86: ; preds = %85, %72
br label %87
87: ; preds = %86, %65
br label %88
88: ; preds = %87, %64
br label %89
89: ; preds = %88, %38
%90 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [5 x i8] c"\0A%d\0A\00"
@.str.2 = [4 x i8] c"%d\0A\00"
@str = [21 x i8] c"\0Anums: infinate loop\00"
@str.5 = [51 x i8] c"\0A usage: nums (or program_name) start stop [inc] \0A\00"
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 = getelementptr inbounds i8*, i8** %1, i64 3
%10 = load i8*, i8** %9
%11 = icmp eq i8* %10, null
br i1 %11, label %14, label %12
12: ; preds = %2
%13 = tail call i32 @atoi(i8* %10)
br label %14
14: ; preds = %2, %12
%15 = phi i32 [ %13, %12 ], [ 1, %2 ]
%16 = icmp slt i32 %0, 3
br i1 %16, label %17, label %20
17: ; preds = %14
%18 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @str.5, i64 0, i64 0))
%19 = tail call i32 @exit(i32 0)
unreachable
20: ; preds = %14
%21 = icmp eq i32 %5, %8
br i1 %21, label %22, label %24
22: ; preds = %20
%23 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %5)
br label %44
24: ; preds = %20
%25 = icmp sgt i32 %5, %8
br i1 %25, label %26, label %33
26: ; preds = %24
%27 = tail call i32 @llvm.abs.i32(i32 %15, i1 false)
br label %28
28: ; preds = %26, %28
%29 = phi i32 [ %5, %26 ], [ %31, %28 ]
%30 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %29)
%31 = sub i32 %29, %27
%32 = icmp slt i32 %31, %8
br i1 %32, label %44, label %28
33: ; preds = %24
%34 = icmp slt i32 %5, %8
br i1 %34, label %35, label %44
35: ; preds = %33
%36 = icmp slt i32 %15, 1
br i1 %36, label %37, label %39
37: ; preds = %35
%38 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
br label %44
39: ; preds = %35, %39
%40 = phi i32 [ %42, %39 ], [ %5, %35 ]
%41 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %40)
%42 = add nsw i32 %40, %15
%43 = icmp sgt i32 %42, %8
br i1 %43, label %44, label %39
44: ; preds = %39, %28, %37, %33, %22
%45 = tail call i32 @putchar(i32 10)
ret i32 0
}