#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*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ stderr;
int main(int argc, char *argv[]) {
  register int i;
  int end, start = 1, step = 1;
  switch (argc) {
  case 4:
    step = atoi(argv[3]);
  case 3:
    start = atoi(argv[2]);
  case 2:
    end = atoi(argv[1]);
    break;
  default:
    fprintf(stderr, "usage: %s end [start [step]]\n", argv[0]);
    return 1;
  }
  for (i = start; i != end; i += step) {
    printf("%d ", i);
  }
  printf("%d\n", i);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x1c(%rbp)
movl   $0x1,-0x20(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x24(%rbp)
sub    $0x2,%eax
je     11aa <main+0x7a>
jmp    1168 <main+0x38>
mov    -0x24(%rbp),%eax
sub    $0x3,%eax
je     119a <main+0x6a>
jmp    1179 <main+0x49>
mov    -0x24(%rbp),%eax
sub    $0x4,%eax
jne    11bf <main+0x8f>
jmp    118a <main+0x5a>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   1050 <atoi@plt>
mov    %eax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1050 <atoi@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1050 <atoi@plt>
mov    %eax,-0x18(%rbp)
jmp    11e7 <main+0xb7>
mov    0x2e1a(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xe2a(%rip),%rsi
call   1040 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    122c <main+0xfc>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
je     1216 <main+0xe6>
mov    -0x14(%rbp),%esi
lea    0xe1b(%rip),%rdi
call   1030 <printf@plt>
mov    -0x20(%rbp),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    11ed <main+0xbd>
mov    -0x14(%rbp),%esi
lea    0xe02(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    $0x1,%ebx
cmp    $0x2,%edi
je     1169 <main+0x39>
cmp    $0x3,%edi
je     1159 <main+0x29>
cmp    $0x4,%edi
jne    11b5 <main+0x85>
mov    0x18(%r14),%rdi
call   1050 <atoi@plt>
mov    %eax,%ebx
mov    %ebx,%r15d
mov    0x10(%r14),%rdi
call   1050 <atoi@plt>
mov    %eax,%ebx
jmp    116f <main+0x3f>
mov    $0x1,%r15d
mov    0x8(%r14),%rdi
call   1050 <atoi@plt>
cmp    %eax,%ebx
je     11a3 <main+0x73>
mov    %eax,%ebp
lea    0xe99(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    %r15d,%ebx
cmp    %ebx,%ebp
jne    1190 <main+0x60>
mov    %ebp,%ebx
lea    0xe78(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
jmp    11d2 <main+0xa2>
mov    0x2e24(%rip),%rax
mov    (%rax),%edi
mov    (%r14),%rdx
lea    0xe38(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [30 x i8] c"usage: %s end [start [step]]\0A\00"
@.str.1 = [4 x i8] c"%d \00"
@.str.2 = [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
%9 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 1, i32* %8
store i32 1, i32* %9
%10 = load i32, i32* %4
switch i32 %10, label %26 [
i32 4, label %11
i32 3, label %16
i32 2, label %21
]
11: ; preds = %2
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i64 3
%14 = load i8*, i8** %13
%15 = call i32 @atoi(i8* %14)
store i32 %15, i32* %9
br label %16
16: ; preds = %2, %11
%17 = load i8**, i8*** %5
%18 = getelementptr inbounds i8*, i8** %17, i64 2
%19 = load i8*, i8** %18
%20 = call i32 @atoi(i8* %19)
store i32 %20, i32* %8
br label %21
21: ; preds = %2, %16
%22 = load i8**, i8*** %5
%23 = getelementptr inbounds i8*, i8** %22, i64 1
%24 = load i8*, i8** %23
%25 = call i32 @atoi(i8* %24)
store i32 %25, i32* %7
br label %32
26: ; preds = %2
%27 = load i32, i32* @stderr
%28 = load i8**, i8*** %5
%29 = getelementptr inbounds i8*, i8** %28, i64 0
%30 = load i8*, i8** %29
%31 = call i32 @fprintf(i32 %27, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %30)
store i32 1, i32* %3
br label %48
32: ; preds = %21
%33 = load i32, i32* %8
store i32 %33, i32* %6
br label %34
34: ; preds = %41, %32
%35 = load i32, i32* %6
%36 = load i32, i32* %7
%37 = icmp ne i32 %35, %36
br i1 %37, label %38, label %45
38: ; preds = %34
%39 = load i32, i32* %6
%40 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %39)
br label %41
41: ; preds = %38
%42 = load i32, i32* %9
%43 = load i32, i32* %6
%44 = add nsw i32 %43, %42
store i32 %44, i32* %6
br label %34
45: ; preds = %34
%46 = load i32, i32* %6
%47 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %46)
store i32 0, i32* %3
br label %48
48: ; preds = %45, %26
%49 = load i32, i32* %3
ret i32 %49
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [30 x i8] c"usage: %s end [start [step]]\0A\00"
@.str.1 = [4 x i8] c"%d \00"
@.str.2 = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
switch i32 %0, label %19 [
i32 4, label %3
i32 3, label %7
i32 2, label %12
]
3: ; preds = %2
%4 = getelementptr inbounds i8*, i8** %1, i64 3
%5 = load i8*, i8** %4
%6 = tail call i32 @atoi(i8* %5)
br label %7
7: ; preds = %2, %3
%8 = phi i32 [ 1, %2 ], [ %6, %3 ]
%9 = getelementptr inbounds i8*, i8** %1, i64 2
%10 = load i8*, i8** %9
%11 = tail call i32 @atoi(i8* %10)
br label %12
12: ; preds = %2, %7
%13 = phi i32 [ 1, %2 ], [ %11, %7 ]
%14 = phi i32 [ 1, %2 ], [ %8, %7 ]
%15 = getelementptr inbounds i8*, i8** %1, i64 1
%16 = load i8*, i8** %15
%17 = tail call i32 @atoi(i8* %16)
%18 = icmp eq i32 %13, %17
br i1 %18, label %28, label %23
19: ; preds = %2
%20 = load i32, i32* @stderr
%21 = load i8*, i8** %1
%22 = tail call i32 @fprintf(i32 %20, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %21)
br label %31
23: ; preds = %12, %23
%24 = phi i32 [ %26, %23 ], [ %13, %12 ]
%25 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %24)
%26 = add nsw i32 %24, %14
%27 = icmp eq i32 %26, %17
br i1 %27, label %28, label %23
28: ; preds = %23, %12
%29 = phi i32 [ %13, %12 ], [ %17, %23 ]
%30 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %29)
br label %31
31: ; preds = %28, %19
%32 = phi i32 [ 1, %19 ], [ 0, %28 ]
ret i32 %32
}