#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 /*<<< orphan*/ isEmpty();
int pop();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ push(int);
int main(int argc, char **argv) {
  int i, k;
  createStack();
  k = 0;
  for (i = 5; i < 100; i = i + 5) {
    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    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1050 <createStack@plt>
movl   $0x0,-0x18(%rbp)
movl   $0x5,-0x14(%rbp)
cmpl   $0x64,-0x14(%rbp)
jge    11da <main+0x8a>
mov    -0x14(%rbp),%esi
lea    0xe71(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%edi
call   1070 <push@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    11c3 <main+0x73>
lea    0xe5a(%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    $0x5,%eax
mov    %eax,-0x14(%rbp)
jmp    117b <main+0x2b>
lea    0xe35(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe27(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x18(%rbp)
mov    $0x0,%al
call   1060 <isEmpty@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1219 <main+0xc9>
jmp    1263 <main+0x113>
mov    $0x0,%al
call   1040 <pop@plt>
mov    %eax,%esi
lea    0xdd7(%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    1255 <main+0x105>
lea    0xdc8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    11fd <main+0xad>
lea    0xdac(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <pop@plt>
lea    0xd85(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
xor    %eax,%eax
call   1070 <createStack@plt>
mov    $0x5,%ebx
mov    $0x1,%ebp
mov    $0xcccccccd,%r15d
lea    0xe6a(%rip),%r14
jmp    11ab <main+0x3b>
nopl   0x0(%rax,%rax,1)
add    $0x5,%ebx
add    $0x1,%ebp
cmp    $0x64,%ebx
je     11e0 <main+0x70>
mov    %ebp,%eax
imul   %r15,%rax
shr    $0x22,%rax
lea    (%rax,%rax,4),%eax
lea    (%rax,%rax,4),%r12d
mov    %r14,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %ebx,%edi
call   1090 <push@plt>
cmp    %ebx,%r12d
jne    11a0 <main+0x30>
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    11a0 <main+0x30>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1080 <isEmpty@plt>
test   %eax,%eax
je     1227 <main+0xb7>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1060 <pop@plt>
lea    0xded(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret
mov    $0xffffffff,%ebp
mov    $0x1,%ebx
mov    $0xcccccccd,%r15d
lea    0xdc2(%rip),%r14
jmp    1251 <main+0xe1>
xor    %eax,%eax
call   1080 <isEmpty@plt>
add    $0xffffffff,%ebp
add    $0x1,%ebx
test   %eax,%eax
jne    11ff <main+0x8f>
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    1240 <main+0xd0>
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    1240 <main+0xd0>

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

LLVM IR (-O2):
@.str = [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()
br label %4
4: ; preds = %2, %14
%5 = phi i32 [ 0, %2 ], [ %9, %14 ]
%6 = phi i32 [ 5, %2 ], [ %15, %14 ]
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = tail call i32 @push(i32 %6)
%9 = add nuw nsw i32 %5, 1
%10 = urem i32 %9, 5
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %4
%13 = tail call i32 @putchar(i32 10)
br label %14
14: ; preds = %12, %4
%15 = add nuw nsw i32 %6, 5
%16 = icmp eq i32 %9, 19
br i1 %16, label %17, label %4
17: ; preds = %14
%18 = tail call i32 @putchar(i32 10)
%19 = tail call i32 @putchar(i32 10)
%20 = tail call i32 (...) @isEmpty()
%21 = icmp eq i32 %20, 0
br i1 %21, label %22, label %34
22: ; preds = %17, %31
%23 = phi i32 [ %26, %31 ], [ 0, %17 ]
%24 = tail call i32 (...) @pop()
%25 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %24)
%26 = add nuw nsw i32 %23, 1
%27 = urem i32 %26, 5
%28 = icmp eq i32 %27, 0
br i1 %28, label %29, label %31
29: ; preds = %22
%30 = tail call i32 @putchar(i32 10)
br label %31
31: ; preds = %29, %22
%32 = tail call i32 (...) @isEmpty()
%33 = icmp eq i32 %32, 0
br i1 %33, label %22, label %34
34: ; preds = %31, %17
%35 = tail call i32 @putchar(i32 10)
%36 = tail call i32 (...) @pop()
%37 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
ret i32 0
}