#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*/ createStack();
int getAnInt(char *);
int /*<<< orphan*/ isEmpty();
int pop();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ push(int);
int main(int argc, char **argv) {
  int i, k, beginning, last, increment;
  createStack();
  beginning = getAnInt("Enter the lowest value:");
  last = getAnInt("Enter the highest value:");
  increment = getAnInt("Enter the increment");
  k = 0;
  for (i = beginning; i < last; i = i + increment) {
    printf("%5d", i);
    push(i);
    if ((k + 1) % 5 == 0)
      printf("\n");
    k++;
  }
  printf("\n");
  printf("\n");
  k = 0;
  while (!isEmpty()) {
    printf("%5d", pop());
    if ((k + 1) % 5 == 0)
      printf("\n");
    k++;
  }
  printf("\n");
  pop();
  printf("We don't get here.\n");
}


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)
mov    $0x0,%al
call   1060 <createStack@plt>
lea    0xe7c(%rip),%rdi
call   1050 <getAnInt@plt>
mov    %eax,-0x1c(%rbp)
lea    0xe85(%rip),%rdi
call   1050 <getAnInt@plt>
mov    %eax,-0x20(%rbp)
lea    0xe8f(%rip),%rdi
call   1050 <getAnInt@plt>
mov    %eax,-0x24(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    1218 <main+0xb8>
mov    -0x14(%rbp),%esi
lea    0xe78(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%edi
call   1080 <push@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1201 <main+0xa1>
lea    0xe61(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
add    -0x24(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    11b7 <main+0x57>
lea    0xe3c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe2e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x18(%rbp)
mov    $0x0,%al
call   1070 <isEmpty@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1257 <main+0xf7>
jmp    12a1 <main+0x141>
mov    $0x0,%al
call   1040 <pop@plt>
mov    %eax,%esi
lea    0xdde(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1293 <main+0x133>
lea    0xdcf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    123b <main+0xdb>
lea    0xdb3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <pop@plt>
lea    0xd8c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
xor    %eax,%eax
call   1080 <createStack@plt>
lea    0xe67(%rip),%rdi
call   1070 <getAnInt@plt>
mov    %eax,%ebx
lea    0xe71(%rip),%rdi
call   1070 <getAnInt@plt>
mov    %eax,%r14d
lea    0xe7b(%rip),%rdi
call   1070 <getAnInt@plt>
cmp    %r14d,%ebx
jge    121a <main+0x9a>
mov    %eax,%r12d
mov    $0xffffffff,%r13d
mov    $0x1,%ebp
jmp    11df <main+0x5f>
add    %r12d,%ebx
add    $0xffffffff,%r13d
add    $0x1,%ebp
cmp    %r14d,%ebx
jge    121a <main+0x9a>
mov    %ebp,%eax
mov    $0xcccccccd,%ecx
imul   %rcx,%rax
shr    $0x22,%rax
lea    (%rax,%rax,4),%r15d
lea    0xe4c(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %ebx,%edi
call   10a0 <push@plt>
add    %r13d,%r15d
jne    11d0 <main+0x50>
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    11d0 <main+0x50>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1090 <isEmpty@plt>
test   %eax,%eax
je     1267 <main+0xe7>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1060 <pop@plt>
lea    0xdf8(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    $0xffffffff,%ebp
mov    $0x1,%ebx
mov    $0xcccccccd,%r15d
lea    0xdc7(%rip),%r14
jmp    1291 <main+0x111>
xor    %eax,%eax
call   1090 <isEmpty@plt>
add    $0xffffffff,%ebp
add    $0x1,%ebx
test   %eax,%eax
jne    1239 <main+0xb9>
mov    %ebx,%eax
imul   %r15,%rax
shr    $0x22,%rax
lea    (%rax,%rax,4),%r12d
xor    %eax,%eax
call   1060 <pop@plt>
mov    %r14,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
add    %ebp,%r12d
jne    1280 <main+0x100>
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    1280 <main+0x100>

LLVM IR (-O0):
@.str = [24 x i8] c"Enter the lowest value:\00"
@.str.1 = [25 x i8] c"Enter the highest value:\00"
@.str.2 = [20 x i8] c"Enter the increment\00"
@.str.3 = [4 x i8] c"%5d\00"
@.str.4 = [2 x i8] c"\0A\00"
@.str.5 = [20 x i8] c"We don't get here.\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
%10 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%11 = call i32 (...) @createStack()
%12 = call i32 @getAnInt(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
store i32 %12, i32* %8
%13 = call i32 @getAnInt(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
store i32 %13, i32* %9
%14 = call i32 @getAnInt(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
store i32 %14, i32* %10
store i32 0, i32* %7
%15 = load i32, i32* %8
store i32 %15, i32* %6
br label %16
16: ; preds = %34, %2
%17 = load i32, i32* %6
%18 = load i32, i32* %9
%19 = icmp slt i32 %17, %18
br i1 %19, label %20, label %38
20: ; preds = %16
%21 = load i32, i32* %6
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %21)
%23 = load i32, i32* %6
%24 = call i32 @push(i32 %23)
%25 = load i32, i32* %7
%26 = add nsw i32 %25, 1
%27 = srem i32 %26, 5
%28 = icmp eq i32 %27, 0
br i1 %28, label %29, label %31
29: ; preds = %20
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
br label %31
31: ; preds = %29, %20
%32 = load i32, i32* %7
%33 = add nsw i32 %32, 1
store i32 %33, i32* %7
br label %34
34: ; preds = %31
%35 = load i32, i32* %6
%36 = load i32, i32* %10
%37 = add nsw i32 %35, %36
store i32 %37, i32* %6
br label %16
38: ; preds = %16
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
store i32 0, i32* %7
br label %41
41: ; preds = %54, %38
%42 = call i32 (...) @isEmpty()
%43 = icmp ne i32 %42, 0
%44 = xor i1 %43, true
br i1 %44, label %45, label %57
45: ; preds = %41
%46 = call i32 (...) @pop()
%47 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %46)
%48 = load i32, i32* %7
%49 = add nsw i32 %48, 1
%50 = srem i32 %49, 5
%51 = icmp eq i32 %50, 0
br i1 %51, label %52, label %54
52: ; preds = %45
%53 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
br label %54
54: ; preds = %52, %45
%55 = load i32, i32* %7
%56 = add nsw i32 %55, 1
store i32 %56, i32* %7
br label %41
57: ; preds = %41
%58 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%59 = call i32 (...) @pop()
%60 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0))
%61 = load i32, i32* %3
ret i32 %61
}

LLVM IR (-O2):
@.str = [24 x i8] c"Enter the lowest value:\00"
@.str.1 = [25 x i8] c"Enter the highest value:\00"
@.str.2 = [20 x i8] c"Enter the increment\00"
@.str.3 = [4 x i8] c"%5d\00"
@str = [19 x i8] c"We don't get here.\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @createStack()
%4 = tail call i32 @getAnInt(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @getAnInt(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 @getAnInt(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
%7 = icmp slt i32 %4, %5
br i1 %7, label %8, label %21
8: ; preds = %2, %18
%9 = phi i32 [ %19, %18 ], [ %4, %2 ]
%10 = phi i32 [ %13, %18 ], [ 0, %2 ]
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %9)
%12 = tail call i32 @push(i32 %9)
%13 = add nuw nsw i32 %10, 1
%14 = urem i32 %13, 5
%15 = icmp eq i32 %14, 0
br i1 %15, label %16, label %18
16: ; preds = %8
%17 = tail call i32 @putchar(i32 10)
br label %18
18: ; preds = %16, %8
%19 = add nsw i32 %9, %6
%20 = icmp slt i32 %19, %5
br i1 %20, label %8, label %21
21: ; preds = %18, %2
%22 = tail call i32 @putchar(i32 10)
%23 = tail call i32 @putchar(i32 10)
%24 = tail call i32 (...) @isEmpty()
%25 = icmp eq i32 %24, 0
br i1 %25, label %26, label %38
26: ; preds = %21, %35
%27 = phi i32 [ %30, %35 ], [ 0, %21 ]
%28 = tail call i32 (...) @pop()
%29 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %28)
%30 = add nuw nsw i32 %27, 1
%31 = urem i32 %30, 5
%32 = icmp eq i32 %31, 0
br i1 %32, label %33, label %35
33: ; preds = %26
%34 = tail call i32 @putchar(i32 10)
br label %35
35: ; preds = %33, %26
%36 = tail call i32 (...) @isEmpty()
%37 = icmp eq i32 %36, 0
br i1 %37, label %26, label %38
38: ; preds = %35, %21
%39 = tail call i32 @putchar(i32 10)
%40 = tail call i32 (...) @pop()
%41 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
ret i32 0
}